Welcome to WebmasterWorld Guest from 54.166.122.69

Forum Moderators: ocean10000

Microsoft JET Database Engine error '80040e14'

   
2:53 pm on May 13, 2006 (gmt 0)

5+ Year Member



Hi there, I keep getting the following error message when trying to update a form........

Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'Cypress Pine'.
/html/advertiser-basic-keyword.asp, line 154

My code reads........

<%
' *** 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
'Response.Write MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>

A response write results in........

update tblResults set idSpecies = Cypress Pine, Spotted Gum, Iron Bark Grey, Cypress Pine, Spotted Gum, Iron Bark Grey, Spotted Gum, Treated Pine, Treated Pine, Treated Pine,idCategory = Decking, Sawn Timber, Landscape Timbers, Landscape Timbers, Dressed Timbers, Dressed Timbers, Dressed Timbers, Treated Timber - LOSP, Treated Timber - ACQ, Treated Timber - CCA where idResults = 5

Can anyone suggest what to do from here. I have been stuck on this for days......

Thanks

Mally

12:49 pm on May 15, 2006 (gmt 0)

10+ Year Member



Well, I have never used dreamweaver for vbscript work (just text editor), but it seems to me that your SQL statement needs to have single quotes 'yourtext' around your text columns.

Try this:
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & "'" & MM_formVal & "'"

8:11 am on May 16, 2006 (gmt 0)

5+ Year Member



Hey there, thanks for replying to me message. I just tried changing the code to read the above and it gave me the following error.

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/html/advertiser-basic-keyword.asp, line 155

TA

Mally

Line 155 is the MM_editCmd.Execute

 

Featured Threads

Hot Threads This Week

Hot Threads This Month