Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft JET Database Engine (0x80040E14)

Status
Not open for further replies.

orangeblue

Programmer
Nov 26, 2002
107
GB
Hi

I got this error in my asp page

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression

Basically I have a script that updates a record using the access version of a store procedure. I think the problem is that is the text has an ‘ or any other characters.

I was wondering if any one can help or has another example of how to uses a sp in access

The code is below

Thanks in advance
Hesh


' Connection Object
Dim con
Set con = Server.CreateObject("ADODB.Connection")

' Recordset Object
Dim rs

response.write gs_desc
' connecting to database
con.Open oConn

' executing stored procedure
Set rs = con.Execute ("exec qry_Admin_product_update '" & gs_title &"', '" & cstr(gs_desc) & "','" & gl_price &"', '"& date() &"', '" & gl_id &"' ")

' showing all records


' closing connection and freeing resources
con.Close

Set rs = Nothing
Set con = Nothing
 
Access uses # as date delimiters...try

#"& date() &"#

and if your variables is an integer then you dont need to use single quotes...

-DNG
 
Hi thanks for that, but i have fount that if i have

gs_desc = "Life's a beach in this" the ' in life's causes the error.

hesh
 
try this:

gs_desc=Replace(gs_desc,"'","''")

what we are doing here is replacing the single apostrophe with two apostrophes to suppress the side effects of single one :)

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top