Recordset Closed After Having Just Being Opened
- From: "Karnifexx" <m.p.fletcher@xxxxxxxxxxxxxx>
- Date: 10 Dec 2006 06:40:11 -0800
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
.
- Follow-Ups:
- Re: Recordset Closed After Having Just Being Opened
- From: Lance Wynn
- Re: Recordset Closed After Having Just Being Opened
- From: Ralph
- Re: Recordset Closed After Having Just Being Opened
- Prev by Date: Re: VB MySQL UPDATE error
- Next by Date: Re: Recordset Closed After Having Just Being Opened
- Previous by thread: VB MySQL UPDATE error
- Next by thread: Re: Recordset Closed After Having Just Being Opened
- Index(es):
Relevant Pages
|
Loading