Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Using SqL with VB

Using SqL with VB

Using SqL with VB

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

   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

RE: Using SqL with VB

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


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close