Timtropolis
Registered User.
- Local time
- Today, 06:33
- Joined
- Jun 17, 2004
- Messages
- 84
Greetings all,
Have a unique scenario here.
I am calling a stored procedure in SQL Server 2008 from my Access 2010 database. (see my code below).
The stored proc returns two completely different recordsets. When I try
to reference the recordset I get the 3704 error.
My question: Is there any way Access can reference the recordsets created by the SQL Server proc? I've tried using indexing when declaring the recordsets as well as the .NextRecordSet method to no avail.
Any help would be most welcome.
TIA,
Tim
Have a unique scenario here.
I am calling a stored procedure in SQL Server 2008 from my Access 2010 database. (see my code below).
Code:
Dim objConnection As New ADODB.Connection
Dim objCom As ADODB.Command
Dim x, y As Variant
Dim rst, rst2 As ADODB.Recordset
Set objCom = New ADODB.Command
objConnection.Provider = "sqloledb"
provStr = "Data Source=Server01;" & "Initial Catalog=xxxx;
User Id=xxxx;Password=xxxx;"
objConnection.Open provStr
x = 38600 'for testing purposes
With objCom
.ActiveConnection = objConnection
.CommandText = "pr_GetOrder (" & x & ")"
.CommandType = adCmdStoredProc
Set rst = .Execute
End With
[COLOR="Red"]rst.MoveFirst [/COLOR]<-- Run-time error '3704':
Operation is not allowed when the object is closed.
The stored proc returns two completely different recordsets. When I try
to reference the recordset I get the 3704 error.
My question: Is there any way Access can reference the recordsets created by the SQL Server proc? I've tried using indexing when declaring the recordsets as well as the .NextRecordSet method to no avail.
Any help would be most welcome.
TIA,
Tim
Last edited: