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

sql in module

Status
Not open for further replies.

weeze2

Technical User
Jun 18, 2002
129
DK
Ok maybe my first question was too vague. But I thought that I could solve the problem with sql. Can some one help me with the syntax of using sql in a module.
How does one use sql in a vb function? Can you write sql in the function or does one have to use it in a string?
 
Within a module:

Code:
CurrentDb.Execute("UPDATE tblStaff SET Status='A';")

Or, if you're doing loads of statements:
Code:
Dim dbs as DAO.Database
Set dbs = DBEngine(0)(0) 'Faster than CurrentDb
dbs.Execute("UPDATE tblStaff SET Status='A';")
dbs.Execute("UPDATE tblMgr SET Status='A';")
dbs.Execute("UPDATE tblDir SET Status='A';")
dbs.Execute("UPDATE tblBoard SET Status='A';")
Set dbs = Nothing
dbs.Close

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top