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
524 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 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