0

Hi, I am having a problem with ADO.Net and ASP.Net, I didn't post this in the ASP.Net forum because eventhough I am using ASP.Net, the problem seems to be with ADO.Net.

Anyway the code:

{
    strSQL  = "UPDATE Clients SET Password = '" + newpass + "'" +
            " WHERE Email='" + User.Identity.Name + "'";;
    dbCon = new OleDbConnection(strCon);
    dbCon.Open();
    dbAdapter = new OleDbDataAdapter();
    dbCom = new OleDbCommand(strSQL,dbCon);
    int x= dbCom.ExecuteNonQuery();
//...code continues

Everytime i execute this, I get an exception thrown message: "Syntax error in UPDATE statement."
I tried this same query in MS Access and it works fine (i am using an Access db).

I have no clue what the error means :sad: I don't think its the SQL statement. I thought it might be the OleDbCommand not having the capability but OleDbDataAdapter.UpdateCommand is also OleDbCommand so that can't be it.

Thanks in advance.

Edited by happygeek: fixed formatting

1
Contributor
1
Reply
2
Views
12 Years
Discussion Span
Last Post by sanctioned
0

i had to put Password in brackets [], Access requires you to put reserved words in [] apparently the word Password in a SQL query was reserved in access.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.