Link to home
Create AccountLog in
Avatar of pratikshahse
pratikshahse

asked on

call store procs from access 2010 vba code

I am trying to call a store proc from my access vba form.  i am trying to use ADODB property to call store procs

    Dim rsETC As ADODB.Recordset
    Dim db As New ADODB.Connection
     Dim cmd As New ADODB.Command


Looks like access 2010 does not support  ADODB anymore. intellisense does not seem to find ADODB anymore. any idea what has replaced  ADODB in 2010
i want following code to be work in 2010

    Dim rsETC As ADODB.Recordset
    Dim db As New ADODB.Connection

    db.Open funConnectionString   -- funconnectionstring is where i have my connection string defined
 
 
    Dim cmd As New ADODB.Command
    Set cmd.ActiveConnection = db
        cmd.CommandText = "bm_GetETCs"
        cmd.CommandType = adCmdStoredProc
        cmd.Parameters("@prj_id") = intPrjID
    Set rsETC = cmd.Execute

Following code is in access 2007 and does not seem to work access 2010.

THanks,
Pratik
Avatar of Anthony Berenguel
Anthony Berenguel
Flag of United States of America image

This might be a silly question but have you included the appropriate reference library first?

I develop in access 2010 at work and I use adodb recordsets all the time.
ASKER CERTIFIED SOLUTION
Avatar of Anthony Berenguel
Anthony Berenguel
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account