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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.