i am populating a dropdown box using the database and iv done this successfully. only problem is that i want to remove dublicates in the dropdown box.
any suggestions on how to achieve this are greatly appreciated!!
here's the code for populating dropdown box.
<%
Dim connection
Dim check
Dim loginData
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection")
connection.Mode = 3
connection.Open("auction1")
Set loginData = Server.CreateObject("ADODB.RecordSet")
check= "SELECT Leaving, Destination, arrTime, depTime FROM Holidays"
Call loginData.Open(check,connection)
On Error Resume Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional //EN">
<HTML>
<HEAD>
<TITLE> Choosen Prices</TITLE>
<link rel="stylesheet" href="../xml%20fligts/style.css" type="text/css">
<br>
<form method="post" name="formname" action="adminOptions.asp" onSubmit="return checksubmit()">
<TABLE>
</TABLE>
</FORM>
<tr><td>
Leaving From:
<TD><select name="Leaving">
<option value="noSelection">Select Your Departure Location
<%
If Request.Cookies ("Leaving")<>"" Then
Call Returning()
Else
Call NewUser()
End If
%>
<%
Sub Returning()
Dim found
found = False
While Not loginData.EOF
%> <OPTION
<%
If(Not found) Then
If Request.Cookies("Leaving")_
= loginData("Leaving")_
Then
Call Response.Write("SELECTED")
found = True
End If
End If
%>
Value = "<%=loginData("Leaving") %>">
<%=loginData ("Leaving")%>
<% Call loginData.MoveNext()
Wend
End Sub
Sub NewUser()
While Not loginData.EOF
%> <OPTION VALUE = "<%=loginData("Leaving")%>">
<%=loginData ("Leaving")%>
<% Call loginData.MoveNext()
Wend
Call loginData.MoveFirst()
End Sub
%>
any suggestions on how to achieve this are greatly appreciated!!
here's the code for populating dropdown box.
<%
Dim connection
Dim check
Dim loginData
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection")
connection.Mode = 3
connection.Open("auction1")
Set loginData = Server.CreateObject("ADODB.RecordSet")
check= "SELECT Leaving, Destination, arrTime, depTime FROM Holidays"
Call loginData.Open(check,connection)
On Error Resume Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional //EN">
<HTML>
<HEAD>
<TITLE> Choosen Prices</TITLE>
<link rel="stylesheet" href="../xml%20fligts/style.css" type="text/css">
<br>
<form method="post" name="formname" action="adminOptions.asp" onSubmit="return checksubmit()">
<TABLE>
</TABLE>
</FORM>
<tr><td>
Leaving From:
<TD><select name="Leaving">
<option value="noSelection">Select Your Departure Location
<%
If Request.Cookies ("Leaving")<>"" Then
Call Returning()
Else
Call NewUser()
End If
%>
<%
Sub Returning()
Dim found
found = False
While Not loginData.EOF
%> <OPTION
<%
If(Not found) Then
If Request.Cookies("Leaving")_
= loginData("Leaving")_
Then
Call Response.Write("SELECTED")
found = True
End If
End If
%>
Value = "<%=loginData("Leaving") %>">
<%=loginData ("Leaving")%>
<% Call loginData.MoveNext()
Wend
End Sub
Sub NewUser()
While Not loginData.EOF
%> <OPTION VALUE = "<%=loginData("Leaving")%>">
<%=loginData ("Leaving")%>
<% Call loginData.MoveNext()
Wend
Call loginData.MoveFirst()
End Sub
%>