Hi, I wroted simply server-sided JavaSript code in *.asp page. I found that here is any problem with ADODB.Recordset object. I create Recordset, call AddNew method and insert row in the customer table. rsFormRec=Server.CreateObject("ADODB.Recordset"); rsFormRec.CursorLocation=AdUseServer; rsFormRec.CursorType=AdOpenKeySet; rsFormRec.LockType=AdLockOptimistic; rsFormRec.ActiveConnection=Application("cnCODBC"); rsFormRec.Open ("SELECT * FROM \"Customer\""); rsFormRec.AddNew; rsFormRec("No.").Value="666666"+unescape("%00"); rsFormRec("Name").Value="Two hells"; rsFormRec.Update; rsFormRec.Close;
Everything is going well. But when I try update this record using WHERE keyword in SQL query, Update method will fail with Error: Expected lexical element not found: )’ was not handled rsFormRec.Open ("SELECT * FROM \"Customer\" WHERE \"No.\"=\'666666\'"); rsFormRec("Name").Value="Three hells"; rsFormRec.Update; rsFormRec.Close; rsFormRec=null;
If I used Connection object to change Record previously created, record is normally changed. //Application("cnCODBC").Execute("UPDATE \"Customer\" SET \"Name\"=\'Three hells\' WHERE (\"No.\"=\'666666\')");
Can you tell me, what’s wrong with Recordset object?
Added 030409
In my opinion I found solution for this problem. If I update table with multiple-word named columns described Error occurs. If I try update field with multiple words in name through Connection.Execute() function, this UPDATE table without errors. This point me to an idea that Error is- in ADO Recordset object
- or in C/ODBC driver
Can you help me with error locating ?