Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 replace command

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-05 : 09:45:35
Katarina writes "I get a syntax error when trying to use replace command on
a request - text field in a form when building an SQL string
to create a record set by executing it. Here is a piece of code:

strSQL="SELECT region,name FROM table WHERE name
like '%" & Replace(Request.Form("text2"),','') & "%' "

The SQL string is to be executed on a ADODB.Recordset.
The single quote to be replaced by two single quotes in the replace command comments out the rest of the statement.
Some single or double quotes are missing somewhere, I just can't figure out where.
How do you go about this?"
   

- Advertisement -