Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does "set DB = Nothing" mean the same as DB.close?? 1

Status
Not open for further replies.

jackiev

MIS
Aug 16, 2000
56
0
0
US
In VB6- programming with database objects,
what is the proper (safest, best) way to
close out from & release connection to a database?

I have seen it coded 2 ways:
Set rsRecord = Nothing
Set dbDatabase = Nothing
and
rsRecord.Close
dbDatabase.Close
Which is correct?
Or should it be all 4 statements to release properly?

 
You should use all 4. First close the recordset, then the database, then set them both to nothing. This will free up alot of resources for you and your end users.

Hope this helps.

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top