Has anybody tried using the LIKE statement in an ASP file running in IIS 5?
I cannot seem to get it to work. Any Ideas?
Here is the lo-down:
--*Conditions*--
1. I am running windows 2000, with IIS5.
2. Using an Access 2000 mdb as the backend database
3. Accessing the mdb in ASP using SQL query
--*Observations*--
1. The query always returns an empty set.
2. I've changed the WHERE clause to say "NOT LIKE", and the asp file will lock up (as if in an infinite loop?)
the following code is a snippet of what I had in my ASP file (the SQL query in the example below is identical to what I used in Access 2000 where it runs fine.
I use this if statement to test for an empty recordset
Earnie Eng - Newbie Access Programmer/DBA
If you are born once, you will die twice.
If you are born twice, you will die once
I cannot seem to get it to work. Any Ideas?
Here is the lo-down:
--*Conditions*--
1. I am running windows 2000, with IIS5.
2. Using an Access 2000 mdb as the backend database
3. Accessing the mdb in ASP using SQL query
--*Observations*--
1. The query always returns an empty set.
2. I've changed the WHERE clause to say "NOT LIKE", and the asp file will lock up (as if in an infinite loop?)
the following code is a snippet of what I had in my ASP file (the SQL query in the example below is identical to what I used in Access 2000 where it runs fine.
Code:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Set myConnection = Server.CreateObject("ADODB.Connection")
set rsRecordSet = server.createObject("ADODB.Recordset")
dbFilePath = Server.MapPath("..\Database\JHA.mdb")
myConnection.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & dbFilePath & ";"
sSQL = "SELECT tblCategory.intCategoryID as CatID, tblCategory.strCategoryName as CatName "
sSQL = sSQL & "FROM tblCategory "
sSQL = sSQL & "WHERE (((tblCategory.strCategoryName) Like '*sc*'));"
rsRecordSet.open sSQL, myConnection, 2, 3
I use this if statement to test for an empty recordset
Code:
if rsRecordSet.EOF then
response.write "empty recordset"
end if
do while not rsRecordSet.EOF
response.write "<p>" & rsRecordSet("CatID") & ": " & rsRecordSet("CatName") & "</p>"
loop
%>
If you are born once, you will die twice.
If you are born twice, you will die once