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

Problems with Apostrophies in String Variables

Status
Not open for further replies.

Rob7

Programmer
Dec 12, 2001
152
US
Hi All,
I am executing a sql statement to get two field values based on two other field values. Most of the time this works, but one of my conditional fields can have an apostrophy in the field and I get a run time error. The statement is being executed against an MS SQL. Is there some way to get around this? I don't think I can kep the users from putting an apostrophy in the string field to begin with.

Thanks.

Rob
 

try...
[tt]
YourVariable = Replace(YourVariable,"'","''")
[/tt]

Good Luck

 
you can massage the input by replacing the ' with `. Your users won't know the difference but the machine will.

`=lowercase umlaut (upper left hand corner)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top