Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help!! problem refreshing form after updating database!!

Status
Not open for further replies.

tuam1234

Technical User
Feb 6, 2004
52
IE
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>
 
Do you change the database values and then when refresh you dont get the new values?

Did you tryed to close the page and go there again?

________
George, M
faq333-4906
 
to both of the questions the answer is yes!!

any ideas?
 
Dropdown doesnt fill at all? or same old values?
Check database records and html output and see if they are same.

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top