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

UPDATE SQL and ADO 1

Status
Not open for further replies.

PaidtheUmpire

Programmer
Jan 4, 2004
105
AU
How do you do it?

I want to update a varaible in my table from the value in the system to value B.


is it something like this?

UPDATE Field_Name TO Variable
FROM Table_Name
WHERE Name = 'Bill';
 

UPDATE Table_Name
SET Field_Name = Variable
WHERE Name = 'Bill'

or, if Field_Name is defined as CHAR or VARCHAR,

UPDATE Table_Name
SET Field_Name = 'Variable'
WHERE Name = 'Bill'

There are several SQL fora here. Check them out.

 
Thanks for that but i can't get it to work...

The program tells me that it says the following

ADOQuery1: CommandText doesn't return a result set.

Any ideas on fixing this?
 

It sounds like you may be trying to use the Open method with that SQL statement. When doing UPDATEs (or INSERTs) the method to use is ExecSQL. "Open" is used for SELECT statements.

If that doesn't help, you should post more of your code so we can see exactly what it is that you are trying to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top