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)
 double quotes in select statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-02-13 : 08:11:43
saurabh writes "Hi,

I want to use a select statement in my asp page which has a where clause that compare something like

eg:
"select sc_id from sc_master where sc_name='" & sc_cat_name&"'"

now sc_cat_name is a variable that has " ( double quotes in it )

how do i handle this.
The query gives error saying either EOF or BOF is true.

Help please.
Regds,
Saurabh."

nr
SQLTeam MVY

12543 Posts

Posted - 2004-02-13 : 09:52:39
Are you sure it's not a single quote? In which case

"select sc_id from sc_master where sc_name='" & replace(sc_cat_name,"'","''") & "'"

If it is double try the same thing.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -