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

Passing parameters to Command object.. 1

Status
Not open for further replies.

Frank123

MIS
Sep 17, 2001
77
US
Hi everyone, I can't seem to find any examples of how to pass parameters to a command object. This is what I have so far :

cmDatabase.CommandText = "INSERT INTO Utilities(System_Site_ID, Utility_ID, Utilities) VALUES (var1, var2, 'Erase')"

I want to pass the variables var1, and var2 into this command but it doesn't seem to work. Somehow I need to set the parameters but can't find an example anywhere on it. Thanks for your help.

 
You probably just need to concatenate your string:

"INSERT INTO Utilities(System_Site_ID, Utility_ID, Utilities) VALUES (" & var1 & ", " & var2 & ", 'Erase')"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top