Hi!
I am trying to dynamically modify my pass-through query containing a
procedure call with 2 parameters.
When I run my access app, I get this error: "Object or provider is not
capable of performing reuqested operation."
Below is my access code:
Dim varItem As Variant
Dim strSQL As String
Dim cat As ADOX.Catalog
Dim cmd As ADODB.Command
Dim strMyDate As String, dtMyDate As Date
dtMyDate = CDate([Forms]![ySalesHistory]![Start Date])
strMyDate = Format(dtMyDate , "yyyymmdd")
strSQL = "procCustomerSa lesandPayments '" & strMyDate & "', '" &
[Forms]![ySalesHistory]![Customer Number] & "'"
Set cat = New ADOX.Catalog
Set cat.ActiveConne ction = CurrentProject. Connection
'= = >NOTE: THIS IS WHERE THE ERROR POPS OUT!
Set cmd = cat.Procedures( "Ben_CustomerSa lesandPayments" ).Command
cmd.CommandText = strSQL
Set cat.Procedures( "Ben_CustomerSa lesandPayments" ).Command = cmd
DoCmd.OpenRepor t stDocName, acViewPreview
Set cat = Nothing
Set cmd = Nothing
Can anyone help me out?
Thanks.
I am trying to dynamically modify my pass-through query containing a
procedure call with 2 parameters.
When I run my access app, I get this error: "Object or provider is not
capable of performing reuqested operation."
Below is my access code:
Dim varItem As Variant
Dim strSQL As String
Dim cat As ADOX.Catalog
Dim cmd As ADODB.Command
Dim strMyDate As String, dtMyDate As Date
dtMyDate = CDate([Forms]![ySalesHistory]![Start Date])
strMyDate = Format(dtMyDate , "yyyymmdd")
strSQL = "procCustomerSa lesandPayments '" & strMyDate & "', '" &
[Forms]![ySalesHistory]![Customer Number] & "'"
Set cat = New ADOX.Catalog
Set cat.ActiveConne ction = CurrentProject. Connection
'= = >NOTE: THIS IS WHERE THE ERROR POPS OUT!
Set cmd = cat.Procedures( "Ben_CustomerSa lesandPayments" ).Command
cmd.CommandText = strSQL
Set cat.Procedures( "Ben_CustomerSa lesandPayments" ).Command = cmd
DoCmd.OpenRepor t stDocName, acViewPreview
Set cat = Nothing
Set cmd = Nothing
Can anyone help me out?
Thanks.
Comment