Solved

Microsoft OLE DB Provider for ODBC Drivers error '80040e14' - [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

Posted on 2009-04-02
7
512 Views
Last Modified: 2012-05-06
Hi guys.
I have a new problem. I'm still working on developing a webdatabase. I develop codes in Dreamweaver CS3 and the database is Access placed on a webhotel.
The problem is on an updateform. I made a lot of similar update-forms and they all work perfect... beside this one. When I click the button to update, I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/crt_survey/crt_survey_edit_note.asp, line 37

Line 37 is the second last line in the code below (MM_editCmd.Execute) I have no idea what is wrong. I used these codes on around 20 other update-pages with no errors. On top of this, this form is the most simple one. Only 1 single field to update! (field = "note" from table="tbl_note").
This issue is driving me nuts! Can you please help me? :o)
Friendly regards
Ullenulle
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

<!--#include file="IsLoggedIn.asp"-->

<!--#include virtual="/Connections/crt_conn.asp" -->

<%

Dim MM_editAction

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))

If (Request.QueryString <> "") Then

  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)

End If
 

' boolean to abort record edit

Dim MM_abortEdit

MM_abortEdit = false

%>

<%

' IIf implementation

Function MM_IIf(condition, ifTrue, ifFalse)

  If condition = "" Then

    MM_IIf = ifFalse

  Else

    MM_IIf = ifTrue

  End If

End Function

%>

<%

If (CStr(Request("MM_update")) = "form1") Then

  If (Not MM_abortEdit) Then

    ' execute the update

    Dim MM_editCmd
 

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")

    MM_editCmd.ActiveConnection = MM_crt_conn_STRING

    MM_editCmd.CommandText = "UPDATE tbl_note SET note = ? WHERE note_id = ?" 

    MM_editCmd.Prepared = true

	MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 255, Request.Form("note")) ' adVarWChar

	MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 5, 1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"), null)) ' adDouble

    MM_editCmd.Execute

    MM_editCmd.ActiveConnection.Close

Open in new window

0
Comment
Question by:ullenulle
  • 3
  • 3
7 Comments
 
LVL 11

Expert Comment

by:mildurait
ID: 24048277
A couple of ideas.

a) Single quotes around the note column
MM_editCmd.CommandText = "UPDATE tbl_note SET note = '?' WHERE note_id = ?"

b) I would test the values in the forms and check for anomalies such as single quotes etc
Response.write("|" & Request.Form("note") & "|")
Response.write("<br/>|" & Request.Form("MM_recordId") & "|")

0
 

Author Comment

by:ullenulle
ID: 24049649
Hi Mildurait.

Ad a) I tried single quotes, but that generated this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/crt_survey/crt_survey_edit_note.asp, line 39

Ad b) The tests were correct. "MM_recordId" were 15 (correct) and "note" did show, what I wrote in the form... but somehow it won't write the stuff to the database.

Any other suggestions?
0
 
LVL 19

Expert Comment

by:daveamour
ID: 24057410
What database are you using?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:ullenulle
ID: 24057672
Hi. As I wrote I'm using Microsoft Access, and everything else is working fine... just this single, stupid form won't update. :-(  All other forms are updating perfectly.
Friendly regards
Ullenulle
0
 
LVL 11

Expert Comment

by:mildurait
ID: 24058117
Have you tried simplifying the command text, even response.writing sql below, copying and running within access?

Dim sql as string
sql = "UPDATE tbl_note SET note = '" & Request.Form("note")  & "' WHERE note_id = " & Request.Form("MM_recordId")

Has this form ever worked?
Is note of string (text/memo) type (not numeric) etc?

0
 
LVL 11

Expert Comment

by:mildurait
ID: 24058122
...must fly for 24 hours..
Sabbatarian.
Hope you can find a solution.
0
 

Accepted Solution

by:
ullenulle earned 0 total points
ID: 24076637
Hi again. No... it didn't work, so I made another solution that works. I guess this is just "one of those things" that happens. :o) Thanks for your suggestions!
Friendly regards
Ullenulle
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now