|
-
Jun 20th, 2000, 05:17 PM
#1
Thread Starter
Lively Member
Is there a way to determine whether a recordset has been instantiated ?
For eg.If I have
Option Explicit
Dim rstDetail As ADODB.recordset
:
:
:
:
Set rstDetail = Conn.Execute("SELECT * FROM Table",,adcmdText)
:
:
If there is a runtime error when executing the above statement, the program will exit. During the exiting function, I will close every recordset that I dimmed but for the above recordset, I will have an error coz' the recordset is not created. So, is there anyway to check the status ? I tried to use 'rstDetail.state = adStateOpen' but failed because this cannot determine whether the recordset has been instantiated.
-
Jun 20th, 2000, 05:29 PM
#2
Fanatic Member
Check if it is nothing, or empty or null or something. Don't know which becuse i haven't used a recordset in ages.
Iain, thats with an i by the way!
-
Jun 20th, 2000, 05:32 PM
#3
Lively Member
I don't know if it works, but try setting it to nothing first:
Code:
Set rstDetail = Nothing
-
Jun 20th, 2000, 05:37 PM
#4
Fanatic Member
When I close a form, I close all my recordsets when I unload the form. If any of the recordsets are not open, and error ocurrs (3704) which I just trap and resume next.
It works for me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|