Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Updating database


Message #1 by tkdubb@l... on Thu, 18 Jan 2001 19:22:25 -0000
I trying to update a record in a table and then redirect to a page that

will show the results of the update.



I'm using Access Database, I'm calling a sub in a vb the code in the asp

page is



<% Case "income" %>



<%



	Visit.Prop.EditIncomeInfo Request("rfrom"), Request("rto"),

Request("cffrom"), Request("cfto"), Request.QueryString("id")



	Response.Redirect "details.asp?id=" & Request.QueryString("id")

	

%>



the code for EditIncomeInfo is as follows



Public Sub EditIncomeInfo(ByVal RFrom As Double, ByVal RTo As Double, _

                          ByVal CFFrom As Double, ByVal CFTo As Double, _

                          ByVal PropID As Integer)

    Dim m_cmd As Command

    Dim ComText As String

    

    Set m_cmd = New Command

    m_cmd.ActiveConnection = m_utility.DB.DB

    m_cmd.CommandType = adCmdStoredProc

    

    ComText = "qryUpdateCashFlowInf"

    ComText = ComText & " " & RFrom & ", " & RTo & ", " & CFFrom & ", " &

CFTo _

                    & ", " & PropID

        

    m_cmd.CommandText = ComText

    

    m_cmd.Execute

End Sub



Everything is working ok but I have to hit refresh on the browser to see

the results. Does anyone now what I can do to either delay loading of the

page or making sure that the update is completed before the redirect is

exicuted



Thaks for any help



Message #2 by "Ken Schaefer" <ken@a...> on Fri, 19 Jan 2001 12:14:26 +1100
Two possible problems:



either:



a) the page that you are using to display the results is being cached by

your browser, and so you are seeing the "old" version rather than getting a

new version from the server. Start expiring your pages so that your browser

is always getting the new version.



b) http://support.microsoft.com/support/kb/articles/Q245/6/76.ASP



Cheers

Ken



----- Original Message -----

From: <tkdubb@l...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, January 19, 2001 6:22 AM

Subject: [asp_databases] Updating database





> I trying to update a record in a table and then redirect to a page that

> will show the results of the update.

>

> I'm using Access Database, I'm calling a sub in a vb the code in the asp

> page is

>

> <% Case "income" %>

>

> <%

>

> Visit.Prop.EditIncomeInfo Request("rfrom"), Request("rto"),

> Request("cffrom"), Request("cfto"), Request.QueryString("id")

>

> Response.Redirect "details.asp?id=" & Request.QueryString("id")

>

> %>

>

> the code for EditIncomeInfo is as follows

>

> Public Sub EditIncomeInfo(ByVal RFrom As Double, ByVal RTo As Double, _

>                           ByVal CFFrom As Double, ByVal CFTo As Double, _

>                           ByVal PropID As Integer)

>     Dim m_cmd As Command

>     Dim ComText As String

>

>     Set m_cmd = New Command

>     m_cmd.ActiveConnection = m_utility.DB.DB

>     m_cmd.CommandType = adCmdStoredProc

>

>     ComText = "qryUpdateCashFlowInf"

>     ComText = ComText & " " & RFrom & ", " & RTo & ", " & CFFrom & ", " &

> CFTo _

>                     & ", " & PropID

>

>     m_cmd.CommandText = ComText

>

>     m_cmd.Execute

> End Sub

>

> Everything is working ok but I have to hit refresh on the browser to see

> the results. Does anyone now what I can do to either delay loading of the

> page or making sure that the update is completed before the redirect is

> exicuted

>

> Thaks for any help






  Return to Index