Need help with some ASP SQL query... 
Author Message
 Need help with some ASP SQL query...

Try using % instead of * ...

--
Michael Harris
MVP Scripting

Why is the "Like" thing does not work? It will execute but the recordset
will be empty!!!

mySQL = "SELECT tblLink.ID, tblCies.NomCie, tblLink.Url, tblLink.DescAn,
tblLink.DescFr, tblLink.Cat, tblLink.SCat " & _
    "FROM tblCies INNER JOIN tblLink ON tblCies.ID = tblLink.Cie " & _
    "WHERE tblCies.NomCie Like '*" & request("txtSearch") & "*'';"

Thanks!

--
________________________________
Luc Vandal
IllusionWorldwide | Webmaster
www.illusionworldwide.net



Mon, 23 Sep 2002 03:00:00 GMT  
 Need help with some ASP SQL query...
Why is the "Like" thing does not work? It will execute but the recordset
will be empty!!!

mySQL = "SELECT tblLink.ID, tblCies.NomCie, tblLink.Url, tblLink.DescAn,
tblLink.DescFr, tblLink.Cat, tblLink.SCat " & _
    "FROM tblCies INNER JOIN tblLink ON tblCies.ID = tblLink.Cie " & _
    "WHERE tblCies.NomCie Like '*" & request("txtSearch") & "*'';"

Thanks!

--
________________________________
Luc Vandal
IllusionWorldwide | Webmaster
www.illusionworldwide.net



Tue, 24 Sep 2002 03:00:00 GMT  
 Need help with some ASP SQL query...
Replace the "*" with "%" on each side and the query will work just fine.

Joseph Scally


Quote:
> Why is the "Like" thing does not work? It will execute but the recordset
> will be empty!!!

> mySQL = "SELECT tblLink.ID, tblCies.NomCie, tblLink.Url, tblLink.DescAn,
> tblLink.DescFr, tblLink.Cat, tblLink.SCat " & _
>     "FROM tblCies INNER JOIN tblLink ON tblCies.ID = tblLink.Cie " & _
>     "WHERE tblCies.NomCie Like '*" & request("txtSearch") & "*'';"

> Thanks!

> --
> ________________________________
> Luc Vandal
> IllusionWorldwide | Webmaster
> www.illusionworldwide.net



Tue, 24 Sep 2002 03:00:00 GMT  
 Need help with some ASP SQL query...
Hello:

        ... where tblCies.NomCie like %' " & Request.Form("txtSearch") & "'%'"

I hope it help :-)
Edward Lau


Quote:

>Why is the "Like" thing does not work? It will execute but the recordset
>will be empty!!!

>mySQL = "SELECT tblLink.ID, tblCies.NomCie, tblLink.Url, tblLink.DescAn,
>tblLink.DescFr, tblLink.Cat, tblLink.SCat " & _
>    "FROM tblCies INNER JOIN tblLink ON tblCies.ID = tblLink.Cie " & _
>    "WHERE tblCies.NomCie Like '*" & request("txtSearch") & "*'';"

>Thanks!



Tue, 24 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need help with printing results from an SQL query in ASP VBScript

2. URGENT: SQL Query help needed!

3. ASP, VBSCRIPT, SQL - need help with one thing

4. need help w/SQL access using ASP Pages

5. Need help with a query, and SQL

6. SQL query-need help!

7. VBA excell + query vers sql 6.5 help needed

8. Newbie needs help with DAO SQL Query Problem

9. Need help executing a sql query in VB 5.0

10. Need Help with Update Query VB 6/SQL 7

11. Help with SQL parameter query needed!

12. Need help with a rdo sql query problem

 

 
Powered by phpBB® Forum Software