charlieb
08-31-2004, 07:09 AM
I am trying to populate a drop down menu with data from sql server database and the page just times out. By the way, I realize there are 2 drop down menus here but right now I'm just trying to get the first one to work. Below is the code, please help:
' Connection string
Dim connStr
connStr = "dsn=mygreatad;uid=notme;pwd=notreal;network=dbmssocn"
' Recordset object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select Distinct ProjectorName from screenshots ", connStr, adOpenForwardOnly, adLockReadOnly, adCmdText
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Projector</title>
</head>
<body bgcolor="#FDE19F" text="#000000">
<form method="POST" action="projectors2.asp">
<table border="1" width="750" height="304">
<tr>
<td width="369" height="18">Projector: <Select Name="ProjectorList" size="1">
<%While Not rs.EOF%>
<option value="<%= rs("ProjectorName")%>"> <%= rs("ProjectorName")%></option>
<%
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
Set connStr = Nothing
%>
</select>
</td>
<td width="365" height="18">Projector: <select size="1" name="D2">
<option selected>Select Projector</option>
</select> <input type="submit" value="Compare" name="B1"></td>
</tr>
<tr>
<td width="369" height="50">Author:<br>
Description:</td>
<td width="365" height="50">Author:<br>
Description:</td>
</tr>
<tr>
<td width="369" height="37">ScreenShots <font face="Arial" size="1">(click
to enlarge)</font></td>
<td width="365" height="37">ScreenShots <font face="Arial" size="1">(click
to enlarge)</font></td>
</tr>
<tr>
<td width="369" height="259" valign="middle" align="center" bgcolor="#FDE19F"><img border="0" src="../Projector/PICT0005.JPG" width="351" height="265">
</td>
<td width="365" height="259" valign="middle" align="center" bgcolor="#FDE19F"> <img border="0" src="../Projector/PICT0005.JPG" width="351" height="265"></td>
</tr>
</table>
</form>
</body>
</html>
' Connection string
Dim connStr
connStr = "dsn=mygreatad;uid=notme;pwd=notreal;network=dbmssocn"
' Recordset object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select Distinct ProjectorName from screenshots ", connStr, adOpenForwardOnly, adLockReadOnly, adCmdText
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Projector</title>
</head>
<body bgcolor="#FDE19F" text="#000000">
<form method="POST" action="projectors2.asp">
<table border="1" width="750" height="304">
<tr>
<td width="369" height="18">Projector: <Select Name="ProjectorList" size="1">
<%While Not rs.EOF%>
<option value="<%= rs("ProjectorName")%>"> <%= rs("ProjectorName")%></option>
<%
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
Set connStr = Nothing
%>
</select>
</td>
<td width="365" height="18">Projector: <select size="1" name="D2">
<option selected>Select Projector</option>
</select> <input type="submit" value="Compare" name="B1"></td>
</tr>
<tr>
<td width="369" height="50">Author:<br>
Description:</td>
<td width="365" height="50">Author:<br>
Description:</td>
</tr>
<tr>
<td width="369" height="37">ScreenShots <font face="Arial" size="1">(click
to enlarge)</font></td>
<td width="365" height="37">ScreenShots <font face="Arial" size="1">(click
to enlarge)</font></td>
</tr>
<tr>
<td width="369" height="259" valign="middle" align="center" bgcolor="#FDE19F"><img border="0" src="../Projector/PICT0005.JPG" width="351" height="265">
</td>
<td width="365" height="259" valign="middle" align="center" bgcolor="#FDE19F"> <img border="0" src="../Projector/PICT0005.JPG" width="351" height="265"></td>
</tr>
</table>
</form>
</body>
</html>