Welcome! Log In Create A New Profile

Advanced

Apostrophe (') in parameter to SQL Server (OLEDcool smiley

Posted by Justin 
Hi Folks

How do I pass a parameter containing an apostrophe (as in D'Artagnon or O'Neill) to SQL Server using the OLEDB driver?

Within SQL Server, it's no problem, you simply double the apostrophe (D''Artagnon). This doesn't work however via the OLEDB driver.

TIA

Justin

I have the same issue sending queries to Oracle :
Triple the quotes to solve this ! (SELECT MUSQUETIER WHERE NAME LIKE 'D'''Artagnan')
...(SELECT HEROE_ACTS FROM MUSQUETIER WHERE NAME LIKE 'D'''Artagnan')


Thanks Leo.

But that doesn't seem to work in the parameter of a Windev Query. No problem with strings without apostrophies, but error generated if there's an apostrophe.

Any other ideas?

Thanks

Justin
A SQLExec(), with the string having the apostrophes doubled, works for me (WD11, SQL Server 2005, OLEDcool smiley.

Kevin
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: