Shurikn Posted August 17, 2004 Posted August 17, 2004 ok... i have a simple query... really simple string sql="UPDATE tblParametre SET image=\"" + nomFichier[nomFichier.Length-1] +"\"" ; SQL.ExecuteNonQuery(sql); wich gives: "UPDATE tblParametre SET image="goutte.JPG"" the name of the pic is only a string... the UPDATE works well if i put it directly in access, but from my code it just wont work the SQL.ExecuteNonQuery comes directly from msdn public static void ExecuteNonQuery(string sql) { OleDbConnection conn = null; try { conn = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + HttpContext.Current.Server.MapPath("rootInextenso.mdb")); conn.Open(); OleDbCommand cmd = new OleDbCommand(sql, conn); cmd.ExecuteNonQuery(); } // catch (Exception e) // { // Response.Write(e.Message); // Response.End(); // } finally { if (conn != null) conn.Close(); } } i really cant see what's wrog with this code... im getting an: Syntax error in the UPDATE statement... wich does not make sense... i tryed to chang the " " " to " ' " i tryed to put a where anything not like something (just to say i had a where... even if it's uselless cuz i dont want any since i want it to apply to the whole table) ... not working Quote
*Gurus* Derek Stone Posted August 17, 2004 *Gurus* Posted August 17, 2004 UPDATE tblParametre SET [image] = 'goutte.JPG' Image is a reserved keyword (datatype). Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.