Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

one works, other doesnt

Posted 26 Jun 2002 20:45:55
1
has voted
26 Jun 2002 20:45:55 Dave Clarke posted:
hi
I have two pages, one updates a members message and the other is for me to update members details, both use the standard MM update behaviour, the one that updates messages works fine but the one that updates members details gives the following error
<b>
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/newreunite/editmember.asp, line 81


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Page:
POST 257 bytes to /newreunite/editmember.asp

POST Data:
frname=****&lname=*****&memname=*****&psswrd=******&accgrup=2&mailadd=******@hotmail.com&tlnum=*******
&adrss1=****&ady2=*****&twn=*****&stat=******&zip=******** . . .

Time:
</b>

i am using asp/javascript with IIS.
here is the code that it says is wrong
<b>
// execute the update
var MM_editCmd = Server.CreateObject('ADODB.Command');
MM_editCmd.ActiveConnection = MM_editConnection;
MM_editCmd.CommandText = MM_editQuery;
MM_editCmd.Execute(); <font color=red> LINE 81</font id=red>
MM_editCmd.ActiveConnection.Close();
if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);
</b>
any ideas anyone??? ive checked the code against the one that works and it is the same

Dave

Edited by - Davecl on 26 Jun 2002 20:47:13

Replies

Replied 26 Jun 2002 21:56:45
26 Jun 2002 21:56:45 David Thomas replied:
Hi Dave,
just a though but when i had problems like this, it was because it was also trying to update the (ID - primary key) so i got the error, i took that field out of the update sequence and it worked.
Worth a shot mate.

"Nobody ever said this stuff was easy"
Replied 26 Jun 2002 22:05:58
26 Jun 2002 22:05:58 Dave Clarke replied:
hi dave

thanks for that, but although the recordset is filtered by memberid it is not included in the update behaviour, so i dont think its that mate.

dave
Replied 27 Jun 2002 19:20:23
27 Jun 2002 19:20:23 Dave Clarke replied:
I have removed the recordset and created it again, removed the server behaviour and added it again, removed it again and used live object update instead of update server behaviour, still no luck, all my other pages that update records are working fine, it's just this one that doesn't.
I've even started afresh with a completely new page and added the form, from objects, recordset and update behaviour, still doesnt work.
HELP PLEASE PLEASE PLEASE
Replied 27 Jun 2002 19:49:57
27 Jun 2002 19:49:57 aegis kleais replied:
Davecl-

The solution usually has to do with the naming convention used with the updating table. Most people see it fit to name fields like "Name", "Date" and "Time" However, these are no-no's because they may be reserved names by either the server or the database itself.

Make it a habit of using Identifier Prefixes.

Ie.

Recordset - rcdUsers
Table - tblUsers
Field - fldUsers

This takes the previous problem out of the realm of possibility and also helps you quickly recognize the data as well. Try renaming your fields accorningly, removing the update server, and reapplying the server behavior at that time.
Replied 27 Jun 2002 19:59:25
27 Jun 2002 19:59:25 Dave Clarke replied:
hi aegiskleais

thanks, i dont think i have got any reserved words for field names or anything like that but will check anyway.

Dave
Replied 27 Jun 2002 20:48:53
27 Jun 2002 20:48:53 Dave Clarke replied:
hi again aegiskleais

checked my field names and guess what? <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
changed a field name and it seems to work now, but now the problem is i've got to go thru all the pages that use that table and alter all the recordsets and dynamic text and so on, sign-up pages, etc etc.
thanks again for your help, i'll get there .. eventually.
Dave
Replied 27 Jun 2002 21:27:00
27 Jun 2002 21:27:00 aegis kleais replied:
np. Which one was the culprit?

If at first you don't succeed, blame the cat.

Reply to this topic