Updation Error (Access Database)

Hi all

i am facing a strange problem that i cannot under stand.

i have a table names user_details (access database.).

and when i want to change the password of a user named admin. it will generating error.

===================================================================

Dim cmdAsNew OleDbCommand("UPDATE USER_DETAILS SET PASSWORD = '11111' WHERE USER_NAME = 'admin'", Conn)

Try

cmd.ExecuteNonQuery()

Catch exAs Exception

EndTry

cmd.Dispose()

===================================================================

Error is.

{System.Data.OleDb.OleDbException}
[System.Data.OleDb.OleDbException]: {System.Data.OleDb.OleDbException}
HelpLink: Nothing
InnerException: Nothing
Message: "Syntax error in UPDATE statement."
Source: "Microsoft JET Database Engine"
StackTrace: " at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at ArticleMngt.SavePassword.SavePassword() in

while except this all part (updation any other table) of the application working fine. i cannot understand where is the problem.

can any one help regading this matter.

[2158 byte] By [PrasantSwain] at [2007-12-23]
# 1

Hi,

Try changing your sql statement with this:

UPDATE [USER_DETAILS] SET [PASSWORD] = '11111' WHERE [USER_NAME] = 'admin'

Coz it might be possible that one of your fields (password prefferebly) is a keyword in access.

cheers,

Paul June A. Domag

PaulDomag at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Thank you Paul it is working now.
PrasantSwain at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...