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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error when using " ' "

Status
Not open for further replies.

guineamation

Programmer
Jan 29, 2002
58
IL
Each time i'm using an inverted comma( " ' ") inside a text submitted through a form i'm getting a syntax error message from the server. Any solution?
 
thread333-577153

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
I have a general reference function SSI that i have on my servers, one of the fucntions is :

Function SQLQuotes(Str1)
If IsObject(str1) then
SQLQuotes = ""
ElseIf IsNull(Str1) then
SQLQuotes = ""
Else
SQLQuotes = Replace(Str1,"'","''")
End If
End Function

Then in Your Update or Query Statements where you're using references from recordsets or values from requested form elements etc...

SQL = "Update DB set field1='" & sqlquotes(request("ailment")) & "' where PrimID=" & Trim(Request("RecordID"))

Hope it helps
 
guineamation:

when do u get the error? when using the database or simply while reading the values?

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top