...

View Full Version : About Patterns



lebronletchev
06-14-2007, 10:55 AM
Hi,

I written a code in ASP, however I am not able to find differents patters.

My code:
_______


index.html


<form method="get" name="theField" action="teste3.asp" onsubmit="makeWord(theField)">
<input type="text" name="look_for" value="" ><BR>
<input type=submit value="search">
</form>

booklet.asp

Dim strKeyword
strKeyword = Request.QueryString("look_for")

rs.Open "Select * from madonna where english like '%" & strKeyword& "%' ", conn
'' for exact matchthis works fine, however for match that starts with some characters or ends with some characters- the script not works!!!

For example:

rs.Open "Select * from madonna where english like '%" & strKeyword "%' ", conn

or

rs.Open "Select * from madonna where english like '%" strKeyword& "%' ", conn

WHY I DONīT FIND MATCHS THAT START BY &strkeyword or ends by match
strkeyword& ??

Thank you very much in advance


LeBRON

Roelf
06-14-2007, 11:14 AM
try:

rs.Open "Select * from madonna where english like '" & strKeyword & "%' ", conn

or

rs.Open "Select * from madonna where english like '%" & strKeyword & "' ", conn
the & is the concatenation oparator. The % is the wildcard. So don't drop the concatenation operator, but the wildcard

lebronletchev
06-14-2007, 11:26 AM
Thank you. Great help!

LeBRON



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum