|
-
Aug 23rd, 2000, 09:36 AM
#1
Thread Starter
Frenzied Member
ADO - rs.Close or set rs=nothing
which one is better?
if i set RS = Nothing do i have to
put
Code:
Set RS = New ADODB.Recordset
before i can use this record again?
thanks
-
Aug 23rd, 2000, 09:42 AM
#2
Fanatic Member
I always use both when closing ...
Code:
rs.Close
set rs = Nothing
I also always "set rs = new adodb.recordset" when re-using a recordset.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 23rd, 2000, 09:43 AM
#3
Fanatic Member
Hi again kovan
Yes if you set it to nothing you have to re-set it.
if you need to use the recordset again, use rs.close and when you come to terminate your app, then set it to nothing
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Aug 23rd, 2000, 09:51 AM
#4
Fanatic Member
Kovan
i found this useful to close recordsets without erros
Code:
If Not rstTemp Is Nothing Then
rstTemp.Close
Set rstTemp = Nothing
End If
I f I have any recordsets in a project I just create a function with the above for each recordset, database, workspace, then I know every thing has been closed properly.
Gary Lowe 
VB6 (Enterprise) SP5
ADO 2.6
SQL Server 7 SP3
OK I know my spelling and grammer is crap so don't quote me on it!
To err is human to take the P! is only natural !!
Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip

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
|