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

SQL Statements - Replace function 1

Status
Not open for further replies.

Neilf

Technical User
May 15, 2001
22
0
0
GB
Just wondered if anybody knew why Ultradev changes your SQL statement by generating a replace function for a variable when creating a recordset, e.g:

WHERE (tblLkpAreaManager.RegionID LIKE '" + Replace(rsList__varRegion, "'", "''") + "')

It doesn't cause any problems except when using a list e.g:
IN ('A','B','C'). It's not as problem to remove it (except that the Ultradev Data Bindings then shows an error), but what is it for and is there any way to stop it?
 
It does that just to make sure that when the SQL is rendered, any single quotes will be changed to double singles... vbscript will interpret that as a single quote and the query will be rendered properly before it is passed to the database...

' is the escape character (comment) in vbscript, and so if there is only one of them in a statement, it will just ignore the rest of it. If there's two, it will render one -- and all is good in the world.

:)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top