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

quotes problem

Status
Not open for further replies.

QTip

Programmer
Mar 7, 2001
66
BE
Hi,

I've made a search system in ASP.
One problem:
in my database (I use access2000), I have some entries that contain a '

When I search on these entries. I get an asp error. It doesn't recognies the '
All other entries work fine.

Does anybody have an idea how I can solve this problem?

thnx!
 
this should really be a faq (if it isn't already).
str_output = replace(str_input, "'", "''") codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
I tried what you guys said but I still have a problem.

I am doing this:-

kunsilliLokali = &quot;'&quot; & request.Form(&quot;kunsilliLokali&quot;) & &quot;'&quot;

'********** Replace Single Quotes with Double Single Quotes to avoid SQL errors
function KillQuotes(theString)
KillQuotes = Replace(theString,&quot;'&quot;,&quot;''&quot;) 'SYNTAX -- Replace(expression, find, replacewith)
end function

if kunsilliLokali <> &quot;''&quot; then
sql = sql & &quot;CouncilName = &quot; & kunsilliLokali & &quot;, &quot;
end if

and the asp is giving me the following error:-

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '''Johann'' '''.


what is my problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top