?
Solved

SQL Update of Memo field

Posted on 2003-03-02
3
Medium Priority
?
623 Views
Last Modified: 2012-06-27
How do I update an Access 2000 "Memo" field using SQL?

I am trying to edit an Access database using ASP/ADO, and every time I try to save a <textarea> form field using a SQL Update statement, I get the error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/d2/admin/modpage.asp, line 194

If I replace the <textarea> with a textbox input, this doesn't help. If I hard-code a string (eg "test") into the script, I still get the error.

Concatenating strings doesn't help.

The relevant bit of code is:

sqlUpdateText = "UPDATE Page SET Text = '" & Request.Form("edit_text") & "' WHERE Page_ID = " & this_edit_id & " "

this_edit_id is the page numer that I want to edit. I'm sure there's no problem with this bit, as I use it for several SQL statements, which don't throw errors.

Request.Form("edit_text") is the <textarea>. -- This is where the prblem lies.

Any ideas? Thanks...

Andy
0
Comment
Question by:apreed
[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
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
mcallarse earned 800 total points
ID: 8051976
Try throwing Text into brackets:

"UPDATE Page SET [Text] = '" & Request.Form("edit_text") & "' WHERE Page_ID = " & this_edit_id
0
 
LVL 4

Author Comment

by:apreed
ID: 8052068
That's great! Thanks very much. You've saved the rest of my hair...

Why does this work?
I couldn't find anything on the web that suggested anything like this as a solution.
0
 
LVL 9

Expert Comment

by:mcallarse
ID: 8052572
Glad to help.

When in doubt, qualify your fields (Page.Text should work as well). The Access query window is a good troubleshooting tool. To use, copy-and-paste the code into the SQL view and execute. The application will try to determine the first point of failure, and highlight the relevant part of your query where possible.

Why? Have to ask Bill. Text is a reserved word, but other reserved words behave differently; the unqualified reference works in a SELECT query without issue, so...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses

743 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