Quote:
|
Originally Posted by rokslide
In access the like statement uses *'s instead of %'s I think.
Look up wildcards in the help to make sure of the syntax.
|
Ok, I have done it a little differently.. here goes.. but still need some help though..
1 - I made this an include page:
<%
DIM conn, ltr
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=e:\repository\fpdb\USERNAMES_PASSWORD S.mdb"
%>
<font face="verdana,arial,helvetica" size="1" ><br></font>
<table cellpadding="1" cellspacing="0" border="0" bgcolor="#666699" width="97%" align="center"><tr><td>
<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr align="center">
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=%23">#</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=A">A</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=B">B</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=C">C</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=D">D</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=E">E</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=F">F</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=G">G</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=H">H</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=I">I</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=J">J</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=K">K</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=L">L</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=M">M</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=N">N</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=O">O</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=P">P</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=Q">Q</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=R">R</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=S">S</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=T">T</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=U">U</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=V">V</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=W">W</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=X">X</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=Y">Y</a></font></td>
<td bgcolor="#e9e9e9"><font face="verdana, arial, helvetica" size="2" ><a href="http://www.psrdocs.com/sortlist.asp?ltr=Z">Z</a></font></td>
</tr>
</table>
</td></tr></table>
2 - Then I made this my main page:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<!-- #INCLUDE FILE="alphabets.asp" -->
<%
DIM con
set con = Server.CreateObject("ADODB.Connection")
con.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=e:\repository\fpdb\USERNAMES_PASSWORD S.mdb"
%>
<%
Dim letter, sql, myConnection
set myConnection = Server.CreateObject("ADODB.Connection")
myConnection.Open "Driver = {Microsoft Access Driver (*.mdb)};DBQ=e:\repository\fpdb\USERNAMES_PASSWORD S.mdb"
letter = request.querystring("letter")
sql = "select FIRM_NAME from FIRMS where name like '" & letter & "%'"
set myResults = myConnection.Execute(sql) %>
<% myResults.movefirst
do while not myResults.eof %>
<p><%=myResults("FIRM_NAME")%></p>
<% myResults.movenext
loop%>
</body>
</html>
<%
myResults.close
set myResults = nothing
%>
3 - BUT.... when I run the page I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/sortlist.asp, line 21
4 - Here is the line code:
Dim letter, sql, myConnection
set myConnection = Server.CreateObject("ADODB.Connection")
myConnection.Open "Driver = {Microsoft Access Driver (*.mdb)};DBQ=e:\repository\fpdb\USERNAMES_PASSWORD S.mdb"
<<<--- Line 21
So... any suggestions??
Thanks for your help..
breeze76