here i have code that helps to populate a dropdown box using the database.
just one problem, when i make a change to the database and refresh the page containing the dropdown box, it doesnt update the dropdown box...
does anyone have any information on how i can refresh the dropdown box when i make any changes to the database...
appreciate any replies!!!
<%
Dim connection
Dim check3
Dim loginData3
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection")
connection.Mode = 3
connection.Open("auction1")
Set loginData = Server.CreateObject("ADODB.RecordSet")
check3= "SELECT DISTINCT arrTime FROM Holidays"
Call loginData3.Open(check3,connection)
On Error Resume Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional //EN">
<HTML>
<br>
<form method="post" name="formname" action="adminOptions.asp" onSubmit="return checksubmit()">
<TABLE>
</TABLE>
</FORM>
Return Time:
<TD><select name="arrTime">
<option value="noSelection">Select Your Arrival Time
<%
If Request.Cookies ("arrTime")<>"" Then
Call Build()
Else
Call User()
End If
%>
</select>
<%
Sub Build()
Dim found
found = False
While Not loginData3.EOF
%> <OPTION
<%
If(Not found) Then
If Request.Cookies("arrTime")_
= loginData3("arrTime")_
Then
Call Response.Write("SELECTED")
found = True
End If
End If
%>
Value = "<%=loginData3("arrTime") %>">
<%=loginData3 ("arrTime")%>
<% Call loginData3.MoveNext()
Wend
End Sub
Sub User()
While Not loginData3.EOF
%> <OPTION VALUE = "<%=loginData3("arrTime")%>">
<%=loginData3 ("arrTime")%>
<% Call loginData3.MoveNext()
Wend
End Sub
%>
</td></tr>
<br><br><br>
</body>
</html>
just one problem, when i make a change to the database and refresh the page containing the dropdown box, it doesnt update the dropdown box...
does anyone have any information on how i can refresh the dropdown box when i make any changes to the database...
appreciate any replies!!!
<%
Dim connection
Dim check3
Dim loginData3
Dim insert
Dim query
Set connection = Server.CreateObject("ADODB.Connection")
connection.Mode = 3
connection.Open("auction1")
Set loginData = Server.CreateObject("ADODB.RecordSet")
check3= "SELECT DISTINCT arrTime FROM Holidays"
Call loginData3.Open(check3,connection)
On Error Resume Next
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional //EN">
<HTML>
<br>
<form method="post" name="formname" action="adminOptions.asp" onSubmit="return checksubmit()">
<TABLE>
</TABLE>
</FORM>
Return Time:
<TD><select name="arrTime">
<option value="noSelection">Select Your Arrival Time
<%
If Request.Cookies ("arrTime")<>"" Then
Call Build()
Else
Call User()
End If
%>
</select>
<%
Sub Build()
Dim found
found = False
While Not loginData3.EOF
%> <OPTION
<%
If(Not found) Then
If Request.Cookies("arrTime")_
= loginData3("arrTime")_
Then
Call Response.Write("SELECTED")
found = True
End If
End If
%>
Value = "<%=loginData3("arrTime") %>">
<%=loginData3 ("arrTime")%>
<% Call loginData3.MoveNext()
Wend
End Sub
Sub User()
While Not loginData3.EOF
%> <OPTION VALUE = "<%=loginData3("arrTime")%>">
<%=loginData3 ("arrTime")%>
<% Call loginData3.MoveNext()
Wend
End Sub
%>
</td></tr>
<br><br><br>
</body>
</html>