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

ADO query

Status
Not open for further replies.

mogura

Programmer
Sep 6, 2003
22
GB
I am using ADOs in the initial coding of a VB datatbase application. I have created an ADO Command object named cndMyCommand and associated it with an ADO Connection object named cnnMyConnection. I want to issue the following UPDATE statement against the database:

UPDATE Employees SET Salary = Salary * 1.10

Is this the correct command to do this?

Set cndMyCommand.CommandText = “UPDATE Employees SET Salary = Salary * 1.10”
cndMyCommand.Execute

If it isn’t can you tell me what I’m doing wrong?

Thanks.
 
Dont use SET when assigning the commandtext, and I would make the command type specific, if you havent elsewhere.

cndMyCommand.CommandType = adCmdText
cndMyCommand.CommandText = “UPDATE Employees SET Salary = Salary * 1.10”

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top