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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Recordset

Status
Not open for further replies.
Dec 11, 2000
46
US
I am haveing a problem with the below page. When I come from the first page "20AddNewME.asp" everything works fine. strQSMEID is set to the querstring value from the previous page. This value is used in the SQL to pull the correct RS and the fields are completed correctly. I am able to change the value for the Location field and hit submit. This will send it to 24ProcAddEdit.asp. This page will update the database and set a Session variable "SV24MEID" and then Respons.Redirect back to the page in question "22AddEditMEPM". The IF Else Then will determine which page it came from and set the strQSMEID variable correctly. When the page redirects, the value for location did not change. When I check the database the value for location has been changed correctly. If I click the submit button again, then I will see the correct value for location. For some reason when the page runs again after being redirected back to this page the recordset does not get re-run. Is there some way I can force this to happen. I tried using the recordset resync method but I am using IIS 4 so I guess that is not supported. If I hit the refresh button on the browser I get a a message that says " The page cannot be refreshed without resending the information. Click retry to resend the information." Is there a way to force this retry?
Sorry for writing a novel.

Thanks
Dale

<%@ Language=VBScript %>

<!--#include file=&quot;adovbs.inc&quot;-->
<!-- #INCLUDE FILE=&quot;DataStore.inc&quot; -->

<BODY>
page 22 <BR>

<%
Dim oConn22, oRS22, strConnect, strQSMEID, SQL22

Set oConn22 = Server.CreateObject(&quot;ADODB.Connection&quot;)'Open Connection
oConn22.Open strConnect

'Begin HOW DID WE GET HERE
If InStr(Request.ServerVariables(&quot;HTTP_REFERER&quot;), &quot;22AddEditMEPM.asp&quot;) Then
strQSMEID = Session(&quot;sv24MEID&quot;)
Response.Write &quot;You came from 24&quot;
Response.Write Session(&quot;sv24MEID&quot;)
ElseIf InStr(Request.ServerVariables(&quot;HTTP_REFERER&quot;), &quot;20AddNewME.asp&quot;) Then
strQSMEID =Request.QueryString (&quot;MEID&quot;)
Response.Write &quot;You came from 20&quot;
ElseIF InStr(Request.ServerVariables(&quot;HTTP_REFERER&quot;), &quot;24ProcAddEdit.asp&quot;) Then
strQSMEID = Session(&quot;sv24MEID&quot;)
Response.Write &quot;You came from 24&quot;
Else
Response.Write &quot;Where did you come from?&quot;
End If
'End HOW DID WE GET HERE

SQL22 = &quot;SELECT tblEquipment.MEID, tblEquipment.Location, tblEquipment.Type, &quot;
SQL22 = SQL22 & &quot; tblEquipment.SerialNumber, tblEquipment.Model, tblEquipment.Specs, tblEquipment.MEDate&quot;
SQL22 = SQL22 & &quot; FROM tblEquipment WHERE (((tblEquipment.MEID)= &quot; & strQSMEID & &quot;));&quot;

Set oRS22 = Server.CreateObject (&quot;ADODB.Recordset&quot;)
oRS22.Open SQL22, oConn22

oRS22.Resync
oRS22.MoveFirst
%>

<Form Action=24ProcAddEdit.asp Method=post Name=22AddEditMEPM>
<BR>
MEID &nbsp <Input Type=&quot;Text&quot; Name=&quot;MEID&quot; Value=&quot; <%Response.Write oRS22(&quot;MEID&quot;)%>&quot;><BR>
Location &nbsp <Input Type=&quot;Text&quot; Name=&quot;Location&quot; Value=&quot; <%Response.Write oRS22(&quot;Location&quot;)%>&quot;><BR>
Type &nbsp <Input Type=&quot;Text&quot; Name=&quot;Type&quot; Value=&quot; <%Response.Write oRS22(&quot;Type&quot;)%>&quot;><BR>
Serial Number &nbsp <Input Type=&quot;Text&quot; Name=&quot;SerialNumber&quot; Value=&quot; <%Response.Write oRS22(&quot;SerialNumber&quot;)%>&quot;><BR>
Model &nbsp <Input Type=&quot;Text&quot; Name=&quot;Model&quot; Value=&quot; <%Response.Write oRS22(&quot;Model&quot;)%>&quot;><BR>
Specs &nbsp <Input Type=&quot;Text&quot; Name=&quot;Specs&quot; Value=&quot; <%Response.Write oRS22(&quot;Specs&quot;)%>&quot;><BR>
Date MEID was entered &nbsp <Input Type=&quot;Text&quot; Name=&quot;MEDate&quot; Value=&quot; <%Response.Write oRS22(&quot;MEDate&quot;)%>&quot;><BR>
<input type=submit value=Submit id=submit1 name=submit1>&quot;
</Form>

</BODY>
</HTML>
 
long shot:
<meta http-equiv=&quot;refresh&quot; content=&quot;1&quot;> (1 sec)
or
u could try some JS:
------------------------------
<script>
function ReSubmitME()
{
document.FORM_NAME.submit();
};
</script>
...........
.....
<body OnLoad=&quot;ReSubmitME();&quot; >
----------------------------------

again, no guarantee here but it might work
All the best!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top