Re: Recordset Closed After Having Just Being Opened
- From: "Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx>
- Date: Mon, 18 Dec 2006 18:11:45 -0700
Do you have "set nocount on" in the stored proc?
"Karnifexx" <m.p.fletcher@xxxxxxxxxxxxxx> wrote in message
news:1165761611.777992.72620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hey,
If someone could help me with this it would be greatly appreciated.
I have the following code, part of a function (irrevlant and parameter
declaration has been removed). Suffised to say the function works most
of the time and a recordset is usually returned. However sometimes, as
is commented the recordset is closed after the execute statement. What
is causing this to happen?
Dim sqlConn As ADODB.Connection
Dim sqlCmd As ADODB.Command
Dim sqlRS As ADODB.Recordset
' Establish connection.
Set sqlRS = New ADODB.Recordset
Set sqlCmd = New ADODB.Command
Set sqlConn = New ADODB.Connection
sqlConn.ConnectionString = CurrentProject.Connection
sqlConn.Open
sqlConn.CursorLocation = adUseClient 'Cache data locally
' Open recordset.
With sqlCmd
.ActiveConnection = sqlConn
.CommandText = ExecuteSP.Name
.CommandType = adCmdStoredProc
.Parameters.Refresh
.Parameters....(removed)
Set sqlRS = .Execute()
End With
'Here the SP has executed correctly but the sqlRS is closed ;(
???!?!?!?
Regards,
Marc
.
- References:
- Recordset Closed After Having Just Being Opened
- From: Karnifexx
- Recordset Closed After Having Just Being Opened
- Prev by Date: Re: DSN's
- Next by Date: Re: DSN's
- Previous by thread: Re: Recordset Closed After Having Just Being Opened
- Next by thread: Out of Stack Space
- Index(es):
Relevant Pages
|
Loading