Automation Error During Execution of Stored Procedure Using ADO

When the execute statement below runs an automation error occurs. I have tried it with both stSQL strings defined below.

Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset

Set cnt = New ADODB.Connection
stSQL = "Proc1"

' stSQL = "exec Proc1"

With cnt
.CursorLocation = adUseClient
.Open stADO
Set rst = .Execute(stSQL, , adCmdStoredProc)

End With

Any ideas?

kedst1

[462 byte] By [kedst1] at [2007-12-23]
# 1

Try asking this in the data.oledb newsgroup:


news://msnews.microsoft.com/microsoft.public.data.oledb
<BLOCKED::news://msnews.microsoft.com/microsoft.public.data.oledb>
-- Cindy

CindyMeister at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 2

Hi,

It looks like your missing your connection string in you ADODB.Connection object. Also I'd use a ADODB.Command object to Execute the stored procedure rather than the Connection object. I tried to find an example for you in my books but had no luck so have a search online and your sure to find an example of calling stored procedures.

DerekSmyth at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 3

I'll take a look in the other forum.
Thanks.

kedst1

kedst1 at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 4

I'm sorry, I did not include the code where I opened the connection. Also, I have tried the command object with similar results.

Thanks

kedst1

kedst1 at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...