Forums
This topic is locked
Jet Error 80040e14 Syntax error in UPDATE
Posted 13 Jan 2006 15:16:27
1
has voted
13 Jan 2006 15:16:27 Barry Smith posted:
<font face='Verdana'><font color=navy>Hi,
I am trying to use the Dreamweaver MX 2004 database system to update an Access table from an ASP VB code.
If you have used this system, then you will know how much code is produced to make the query.
I have not edited the code produced by Dreamweaver, but I am still getting this error.
I have checked that the database will accept zero entries, which it will and that the the code is looking at the correct record.
Can anyone think of any reason why this would be happaning.
If seeing the code is of help, please see below.
<pre id=code><font face=courier size=2 id=code>' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update") <> "" And CStr(Request("MM_recordId") <> "" Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If</font id=code></pre id=code>
Thanks,
</font id='Verdana'></font id=navy>
Barry Smith
BKS Graphic Design
www.bksgd.co.uk
Replies
Replied 13 Jan 2006 16:14:38
13 Jan 2006 16:14:38 Javier Castro replied:
I'm no coder but I have had the same problem, before. And the problem was that I was Using a reserved word on my DB. Here is a list of reserved words: support.microsoft.com/?id=248738
By changing the word it could possibly work. i.e. Date change it to dteDate or txtDate
Hope it helps,
Javier
By changing the word it could possibly work. i.e. Date change it to dteDate or txtDate
Hope it helps,
Javier
Replied 13 Jan 2006 16:54:38
13 Jan 2006 16:54:38 Barry Smith replied:
<font face='Verdana'><font color=navy>
Javier,
Thanks for your guidance.
I was using 'password' as a column header!
I changed it and that fixed the problem.
Cheers,
</font id=navy></font id='Verdana'>
Barry Smith
BKS Graphic Design
www.bksgd.co.uk
Javier,
Thanks for your guidance.
I was using 'password' as a column header!
I changed it and that fixed the problem.
Cheers,
</font id=navy></font id='Verdana'>
Barry Smith
BKS Graphic Design
www.bksgd.co.uk