Guest_imported
New member
- Jan 1, 1970
- 0
I just started learning ASP about a week ago and am having a problem. My total goal is this: I have my first page that contains 2 text boxes. 1: name="addr" 2: name="zip"
To start out, what I'd like to accomplish is that when the user clicks on the submit button a query is ran against an MS Access database connection called "Vote" and queries the table "Moline". The zip must match exactly and the addr will be queried with a wildcard at the end, but must have the matching zip code.
My SQL is this (I need the Polling field on a later page-PrpAddr,PrpZip, and Polling are fields from the db):
SELECT PrpAddr, PrpZip, Polling " & "FROM Moline " _
& "WHERE PrpAddr LIKE '" & addr, "'", "''"
& "%' " _
& "AND PrpZip LIKE '" & zip, "'", "''"
& "' " _
& "ORDER BY PrpZip;"
I want the "zip" data to display as html text on the page. However, I want all of the qualified "PrpAddr" from the table to fill a drop down box. How do I accomplish this:
My html code for the first page is this(not much there yet):
<html>
<head>
<title>Polling Places - Main Page</title>
</head>
<body>
<center>
<br><font face="Arial,Helvetica"><font color="#000080"><font size=+1>Search
our Database to find your Polling Place.</font></font></font></center>
<br>
<form action="Info.asp" method="get">
<center><table BORDER=0 CELLSPACING=3 CELLPADDING=8 WIDTH="70%" >
<tr>
<td ALIGN=RIGHT><font face="arial" size="4"><b>Enter House Number <u>only</u> here:</b></td>
<td><input name="addr" SIZE="25" MAXLENGTH="25" /></font></td>
</tr>
<tr>
<td ALIGN=RIGHT><font face="arial" size="4"><b>Enter 5-digit Zip Code here:</b></td>
<td><input name="zip" SIZE="5" MAXLENGTH="5" /></font></td>
</tr>
</table></center>
<br><center><input type="submit" /></center>
</form>
</body>
</html>
Hope this isn't too long, but I wanted to make sure I explained myself. Once I figure this part out, I want the user to select one of the addresses from the drop down box and based on that selection, it pulls the polling field for that record and displays it on the page. I have other code, but figured I was already getting too lengthy. Thanks!
To start out, what I'd like to accomplish is that when the user clicks on the submit button a query is ran against an MS Access database connection called "Vote" and queries the table "Moline". The zip must match exactly and the addr will be queried with a wildcard at the end, but must have the matching zip code.
My SQL is this (I need the Polling field on a later page-PrpAddr,PrpZip, and Polling are fields from the db):
SELECT PrpAddr, PrpZip, Polling " & "FROM Moline " _
& "WHERE PrpAddr LIKE '" & addr, "'", "''"
& "AND PrpZip LIKE '" & zip, "'", "''"
& "ORDER BY PrpZip;"
I want the "zip" data to display as html text on the page. However, I want all of the qualified "PrpAddr" from the table to fill a drop down box. How do I accomplish this:
My html code for the first page is this(not much there yet):
<html>
<head>
<title>Polling Places - Main Page</title>
</head>
<body>
<center>
<br><font face="Arial,Helvetica"><font color="#000080"><font size=+1>Search
our Database to find your Polling Place.</font></font></font></center>
<br>
<form action="Info.asp" method="get">
<center><table BORDER=0 CELLSPACING=3 CELLPADDING=8 WIDTH="70%" >
<tr>
<td ALIGN=RIGHT><font face="arial" size="4"><b>Enter House Number <u>only</u> here:</b></td>
<td><input name="addr" SIZE="25" MAXLENGTH="25" /></font></td>
</tr>
<tr>
<td ALIGN=RIGHT><font face="arial" size="4"><b>Enter 5-digit Zip Code here:</b></td>
<td><input name="zip" SIZE="5" MAXLENGTH="5" /></font></td>
</tr>
</table></center>
<br><center><input type="submit" /></center>
</form>
</body>
</html>
Hope this isn't too long, but I wanted to make sure I explained myself. Once I figure this part out, I want the user to select one of the addresses from the drop down box and based on that selection, it pulls the polling field for that record and displays it on the page. I have other code, but figured I was already getting too lengthy. Thanks!