Update statement not working for VB->Access

  • Thread starter Thread starter Anil Gupte
  • Start date Start date
A

Anil Gupte

This statement:
Update Profiles set ProfileName='Kids', Current=True,
ProfileDescription='Kids', Password='Kids' where ProfileID=2
as also:
Update Profiles set ProfileName='Kids', Current=Yes,
ProfileDescription='Kids', Password='Kids' where ProfileID=2

works within Access. But neither of the above statements work when using
them from VB. I get a "Syntax Error in Update command."

Also, Insert statements into the same database, same program work fine.

Help!

TIA,
 
Anil Gupte said:
This statement:
Update Profiles set ProfileName='Kids', Current=True,
ProfileDescription='Kids', Password='Kids' where ProfileID=2
as also:
Update Profiles set ProfileName='Kids', Current=Yes,
ProfileDescription='Kids', Password='Kids' where ProfileID=2

works within Access. But neither of the above statements work when
using them from VB. I get a "Syntax Error in Update command."

Also, Insert statements into the same database, same program work
fine.

Can you please show us the VB.Net code? If you don't use the OleDBCommand's
Parameters property (cmd.Parameters), use it.


Armin
 
Try

Current=1

or


Armin Zingler said:
Can you please show us the VB.Net code? If you don't use the
OleDBCommand's Parameters property (cmd.Parameters), use it.


Armin
 
OK, never mind I figured it out.

Update Profiles set Profiles.ProfileName='Kids', Profiles.Current=True,
etc...

i.e. I had to use TableName.Field instead of just Field.

Go figure - never seen that before.

Thanx anyway,
 
OK, never mind I figured it out.
Update Profiles set Profiles.ProfileName='Kids', Profiles.Current=True,
etc...

i.e. I had to use TableName.Field instead of just Field.

Go figure - never seen that before.

I think I've seen something like this a while ago. It seemed to be the name
of one particular field that it didn't like. I assume it must have been a
reserved word in OleDB but not in Access itself, or something like that. Try
renaming the 'Current' field to something else, and see if that helps.
 
Back
Top