Well, you didn't say what the name of your "ID" field is, in the DB table.
So I have just called it
ID. If it is something else, just change then names as shown in red.
Code:
<%@LANGUAGE="VBSCRIPT"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search for Landmarks</title>
<style type="text/css">
body,td,th {
color: #0FF;
}
body {
background-color: #000;
}
.Fonts {
font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
}
.Fonts2 {
color: #FFF;
}
</style>
</head>
<body class="Fonts">
<h2>Landmark Search
</h2>
<p class="Fonts2">Landmark Name:</p>
<form name="form1" method="get" action="LandmarkInfo.asp">
<p>
<select name="Landname">
<option value="">--choose one--</option>
<%
<!--#include file="Connections/Landmarks.asp" -->
<%
Set conn = Server.CreateObject ("ADODB.Connection")
conn.Open MM_Landmarks_STRING
SQL = "SELECT ID, LandName FROM dbo.tblLandmark ORDER BY LandName ASC"
Set RS = conn.Execute( SQL )
Do Until RS.EOF
id = RS("ID")
name = RS("LandName")
%>
<option value="<%=id & "$$" & name%>"><%=name%></option>
<%
RS.MoveNext()
Loop
RS.Close
Conn.Close
%>
</select>
</p>
<p>
<input type="submit" />
<input type="reset" name="Reset" id="Reset" value="Reset" />
</p>
</form>
</body>
</html>
Now, that means that when this page is submitted to your "LandmarkInfo.asp" page, you will be getting something like
Code:
371$$Washington Monument
when you use code such as
Code:
landmark = Request.QueryString("landname")
So you will want to separate the ID from the name using code something like this:
Code:
parts = Split( Trim( Request("landname") ), "$$" )
id = CLNG(parts(0))
landmarke = parts(1)