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

recalculate after update

Status
Not open for further replies.

jordan11

Technical User
May 24, 2003
150
0
0
GB
Hi,

I have a page called calculation.asp


I have another page that you can do updates on by clicking on the hyper links that opens up a page to be updated. Everytime some clicks on these links and does an update I would like calculation.asp to be recalculated.
This is an example of one the pages that should cause calculation.asp to be recalculated after update.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<!--#include file="connect.asp" -->
<title>Physician Career</title>
</head>
<body>

<%

'if isempty ( session("clientid")) then
'Response.Redirect "clientlogin.asp"
'end if

Dim rs, rd
set rs=server.createobject("ADODB.recordset")
txtSQL= "SELECT * FROM States"
Set rs=conn.Execute(txtSQL)

txtSQL = "Select * FROM Specialties"
Set rd = conn.Execute (txtSQL)

txtSQL = "Select * FROM Clientopportunity WHERE opportunityID = '" & REQUEST("opportunityid") & "'"
Set rt = conn.Execute (txtSQL)


Errhandlerr Conn


SELECT CASE Request("Validate")
CASE "1"

Updateclientopp

CASE ELSE
DisplayForm
END SELECT


Sub DisplayForm()

%>
<form ACTION="ClientOpportunity.asp" METHOD="POST" name="Register" onSubmit="return submitform(document.Register)">
<input type="hidden" name="clientId" value="<%=request("clientID")%>">
<input type="hidden" name="Validate" value="1">
<table width="900" align="center" style="BORDER-RIGHT: #000000 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-BOTTOM: black 2px solid">

<tr>
<th width="272" scope="row"><div align="left">Location City </div></th>
<td width="12">&nbsp;</td>
<td width="619"><input name="txtcolcity" type="text" id="txtcolcity"></td>
</tr>
<tr>
<th height="5" colspan="2"scope="row"><div align="center"></div></th>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td colspan="5"scope="row"><input type="submit" name="Submit" value="Next">&nbsp;&nbsp;&nbsp;<input name="Reset" type="reset" value="Reset"></td>
</tr>
<tr>
<th height="5" colspan="2"scope="row"><div align="center"></div></th>
<td>&nbsp;</td>
</tr>
</table>
</form>

<%
end sub


sub Updateclientopp ()





Dim rsop


set rsop = server.CreateObject("ADODB.Recordset")


rsop.open "ClientOpportunity", conn, 1, 2, adCmdTableDirect

rsop.Addnew
rsop("clientid") = Request.form("clientid")
rsop("CLocationCity") = Request.Form("txtcolcity")

rsop.Update






client = Request("clientid")


set rsphy = server.CreateObject("ADODB.Recordset")

txtSQL = "SELECT OpportunityId FROM clientopportunity WHERE clientid = '" & client & "'"

set rsphy = conn.execute (txtSQL)


Session("OpportunityId") = rsphy("OpportunityId")


rsop.close

end sub
%>

<hr>
</body>
<!--#include file="disconnect.asp" -->
</html>

Thanks in advance
 
OK a few questions:

1) Does calculation.asp display anything to screen or does it just calculate stuff in the background (maybe update a database)

2) If it does display to screen do you want calculation.asp to replace what is displayed by the code above?

3) Are you using frames with calculation.asp in one frame and the above code in another?

Tony

Spirax-Sarco - steam traps control valves heat exchangers
Sun Villa - Luxury Florida accommodation
 
Thanks for your reply,
but I would like the calculations done in the background and then update the database with the new results.I will just like the calculations.asp to be recalculated everytime one of the other asp pages are updated.


Thanks again
 
You could use XMLHTTP too and set it to asynchronous mode.

Regards
Satish
 
I will try tony's method but not sure how to do your suggestion Satish, any e.g's
 
jordan11

Here is sample code for using the XMLHTTP:
Code:
strURL = "[URL unfurl="true"]http://www.yourwebsite.com/CALCULATION.ASP"[/URL]
Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", strURL, false
objXML.Send
Set objXML = Nothing

Also search for XMLHTTP on the net and you will find more examples.

Regards
Satish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top