Discussion Locked

Using the 'Like' qua on Access DB / Inet

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am having trouble passing input variables to an Access DB selector using the 'Like' qualifier on an asp. I am using Frontpage 2002. Any help would be appreciated.

3 replies

by andrew

The following code works for me:

<%Option Explicit%>

<%
Dim sDSN
Dim oCon
Dim oRS

on error resume next
sDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=z:\avg.mdb;"
Dim sSql

Set oRS=server.CreateObject("ADODB.recordset")
sSql = "SELECT [id],[name] FROM Table3 WHERE Name LIKE '%John%';"
oRS.Open sSql,sDSN
oRS.MoveFirst
Do while not oRS.EOF
Response.Write ""
Response.Write oRS.Fields("Name") & "" & vbCrLf
oRS.movenext
loop

%>

This discussion is closed to new replies.