PDA

Click to See Complete Forum and Search --> : update and delete problem


nigel_chong98
May 18th, 2000, 01:27 PM
How do i update and delete a record from my database?
Anything wrong with the ones below. I keep getting errors.

set db = (c:\chalir\smarkpack_pack.mdb)
db.Execute "UPDATE smartpack SET neutronid = '"& sneutronid&"' AND dateinstalled = '"& sdateinstalled &"' WHERE sidelocation = '"& ssidelocation &"' AND currentuse = '"& scurrentuse &"'

and
set db = (c:\chalir\smarkpack_pack.mdb)
db.Execute "DELETE FROM smartpack WHERE neutronid = '"& sneutronid &"'

Pls advise. Thanks.

Ianpbaker
May 18th, 2000, 07:09 PM
Hi nigel_chong98

To sort out your update problem replace the AND's with commas in the Set part eg. UPDATE tbltest set a = 1, b=2, c=3 etc.

I can't see anything wrong with your delete statement though.

Hope this helps

Ian

[Edited by Ianpbaker on 05-19-2000 at 01:11 PM]

LG
May 18th, 2000, 11:37 PM
What kind of error do you get?
What data type is 'sneutronid'?

ramdasv
May 19th, 2000, 12:23 AM
Try giving a space before the WHERE and AND words.
May be there is problem with string formatting.

Ramdas