Forum Moderators: open

Message Too Old, No Replies

Update time?

after server.transfer an access field shows no change

         

kyjeasp

12:12 am on Apr 26, 2006 (gmt 0)

10+ Year Member



Hello all,
When doing a Server.Transfer is there a delay to see a change show up on the ASP page?

Let me show you my code:

(login.asp file)

Else IF (RS("login") = "True") and (RS("logout") = "True") and DateDiff("d",RS("logindate"),date)>0 then
conn.Execute ("UPDATE history SET timetoday= 0 WHERE patronID='" & idnum & "'")

Server.Transfer "login2.asp"

When the login2.asp page opens up response.write rs("timetoday") shows the value before the script on login.asp is run. If you open the history table in access the value of timetoday is 0. Once login2.asp is refreshed then the value of timetoday is shown as 0.

Here is the display code in login2.asp:

<%
if rs.eof then
' There is no record to match the PatronID
%>
<TR>
<td><strong>Total Time Today: 0 minute(s)</strong></td>

</TR>
<%
Else
%>

<TR>
<td><strong>Total Time Today: <% Response.Write today %> minute(s)</strong></td>

</TR>

<%
END IF

%>

Any ideas on how to get what is actulally in the database to display on the screen withought manually refreshing the screen?

Thank you for your time,
Kyle

emsaw

7:04 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



kyjeasp,

you'll need to pop your recordset again if you want the new value.

currently it looks like this:

populate dataset
change db value
read dataset value

you'll need to change it to requery for the new value

populate dataset
change db value
repopulate dataset
read dataset value

this should be what you want.

-Mark

kyjeasp

12:34 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



Mark,
Thanks. I knew that the recordset had to be opened again, but thought that when the next page loaded that would take care of it. Oops!

Thanks again,
Kyle