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

problem using UPDATE sql command

Status
Not open for further replies.

Erbium

Programmer
Aug 30, 2007
22
US
Hi all

I've got a vb 2005 form with textboxes for data from fields and buttons: read, write, update, del

I've got it querying an access database, and grabbing data from a table.

Read works, if record already present, does a SELECT
write works, if record NOT present, does an INSERT
del works, the record is gone after I click this, does DELETE

but for the life of me I can't get UPDATE to work.
I've tried single and double quotes, ';' at end or not,
and just one or two values in the database. I've looked in SQL for Dummies, syntax appears to be OK.

E.G.
UPDATE Nodes SET showid = showid.text WHERE nodeid = '7';

and then same command execute logic as in other buttons.

I actually stop and put the sql it is sending into a message box when it hits the UPDATE command. Looks OK.

What is weirder is that it doesn't appear to be erroring in sql as it never hits the 'catch' area. When I try write button (with 'INSERT' SQL command behind it) it does hit catch area under its button if exists.

Any ideas? I'm at Witt's End, in a maze of twisty little passages, totally lost.
 
Code:
UPDATE Nodes SET showid = showid.text WHERE nodeid = '7';

Try "UPDATE Nodes SET showid = '" & showid.text & "' WHERE nodeid = '7'"


Silence is golden.
Duct tape is silver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top