Cannot get ADO in VB to recognize a Access parameterized query as stored procedure 
Author Message
 Cannot get ADO in VB to recognize a Access parameterized query as stored procedure

Hi all,

I am just getting start with ADO. I need to execute an Access  parameterized
query. I follow the example form MS migrating from DAO to ADO document.
My code looks like this:

    Const ProviderStr  As String = "Provider=Microsoft.Jet.OLEDB.3.51"
    dim cnnMain as new ADODB.connection
    Dim catTasklist As New ADOX.Catalog
    Dim cmdTasklist As ADODB.Command
    dim rstTaskList as new adodb.recordset

    Dim strTmp As String

    strTmp ="Provider=Microsoft.Jet.OLEDB.3.51;DataSource= c:\dabadmin.mdb"
    cnnMain.Open strTmp
    catTasklist.ActiveConnection = cnnMain
    Set cmdTasklist = catTasklist.Procedures("qryTaskListforaJob").Command
    cmdTasklist.Parameters("inJob") = "dailysync

    rstTasklist.Open cmdTasklist, cnnMain, adOpenForwardOnly,
adLockReadOnly, adCmdStoredProc

Error occurs when the program hit the line of "Set cmdtasklist". It is a ADO
3265 errror which says it cannot find the object in the collections. I 've
double checked many times to make sure I am using the correct name of my
query. I've used immediate window to looks at the items in the PROCEDURES
collection. I've other query that I've defined in the ACCESS database,
except the one I want to execute. It likes it is completely disappeared.

I am using Microsoft.Jet.OLEDB.3.51 driver and the project reference ADO 2.1
object library as well as ADO recordset objects 2.1 library.

Please help. Any suggestion will be very appreciated.

Ling



Sun, 14 Jul 2002 03:00:00 GMT  
 Cannot get ADO in VB to recognize a Access parameterized query as stored procedure
Please see reply at 1:44 PM with an example of parameterized query.


Sun, 14 Jul 2002 03:00:00 GMT  
 Cannot get ADO in VB to recognize a Access parameterized query as stored procedure
I'm interested too, so one question; which of the many
cross-posted newsgroups is the reply in?
Quote:

>Please see reply at 1:44 PM with an example of parameterized query.



Sun, 14 Jul 2002 03:00:00 GMT  
 Cannot get ADO in VB to recognize a Access parameterized query as stored procedure
Hi all,

I just fixed the problem by using Microsoft.Jet.OLEDB.4.0 instead of 3.51.
The driver is from MDAC 2.1.

Thanks anyway.

Circe



Quote:
> I'm interested too, so one question; which of the many
> cross-posted newsgroups is the reply in?


> >Please see reply at 1:44 PM with an example of parameterized query.



Sun, 14 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Cannot get ADO in VB to recognize a Access parameterized query as stored procedure

2. Getting List of Stored Queries in Access using ADO

3. Execute parameterized query stored in ACCESS-2 DB thru VBA

4. Parameterized access query, and ADO

5. No data returned using Access parameterized query and ADO

6. howto do a parameterized query to Access with ADO

7. Using Access Parameterized queries from VB datacontrol????

8. How to call stored, parameterized query

9. Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures

10. Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures

11. Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures

12. Cannot delete an ADO query in Access 2000

 

 
Powered by phpBB® Forum Software