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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SqL with VB 1

Status
Not open for further replies.

MikeCt

Programmer
Joined
Nov 6, 2001
Messages
44
Location
US
My question is more for my general understanding

If I open and view a table using a SQL string like this

gstrSQL1 = "SELECT * From Consignors ORDER BY [Last Name],[First Name];"
Set rsRs1 = gSequelDB.OpenRecordset(gstrSQL1, dbOpenSnapshot)

I know I have to close it with code like this after all my viewing of the records is complete

rsRs1.Close
Set rsRs1 = Nothing

Not for the part I not sure about

If I use a SQL string like this to update a record in the table do I have to close it as above or is the operation completed with the update?

gstrSQL1 = "UPDATE Users SET Password = 'AutoLogonNo' WHERE RecordID = 1"
gSequelDB.Execute gstrSQL1, dbSeeChanges


Thank you
Mike
 
A recordset is an object and should be closed and then set to nothing when it is no longer needed. A query is not an object. There is nothing to close.

David Paulson

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top