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

Darn Apostrophes!!! 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a form which submits data to the database via a text field. The code works fine. But if I have an entry with an apostrophe in it like this -

Nelson's

then I get the error message

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

Is there anything I can do? I want to be able to add entries with apostrophes.

Many thanks

James
 
Here's a nice little function that bypasses all apostrophe and quote problems:

<%Function apostrophe(strIn)
apostrophe = replace(strIn,chr(34),chr(180)&chr(180))
apostrophe = replace(apostrophe,chr(39),chr(180))
End Function%>

to use:
StrSql = &quot;insert into Table (Field) Values (&quot;
StrSql = StrSQl & &quot;'&quot; & apostrophe(Incoming_field) & &quot;')&quot;

Later,
Ken Kasmar
Red Falcon Internetworking, Inc.
[sig][/sig]
 
ken,

i have the same problem querying my database. My database entries have apostrophes in them, and if I replace the apostrophe on my search string with char80, there wouldn't be any match. How do I replace the apostrophes on my database with char80, I can't seem to find that character on the keyboard. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top