Database updating three times

Results 1 to 3 of 3

Thread: Database updating three times

  1. #1
    Colby Berg Guest

    Default Database updating three times

    I am currently working on an .ASP page that contains several links used to download documents in various formats (word, excel, pdf). <BR><BR>Process: <BR>-User clicks on one of these links I send them to an ASP script that queries a database to get the path to the document requested. <BR>- Script then writes information such as the user&#039s ID, the type of document downloaded, and the date and time it was requested to a "Documents Requested Log". <BR>- "Response.Redirect" the user to the document using the path I retrieved from the database. <BR><BR>Problem: The log is updated correctly but it is updated 3 times, each entry about 1 second apart. <BR>- When I comment out the "Response.Redirect", the log is updated only once. <BR>- When I redirect the user to another site rather than the document path, the log is updated only once.<BR><BR>Any ideas on this problem?

  2. #2
    MG Guest

    Default How about some code

    Show your code.

  3. #3
    Colby Guest

    Default RE: How about some code

    This is the page that is called when a document download link is clicked:<BR><BR>&#060;%<BR>email = Request.QueryString("e")<BR>agentID = Request.QueryString("a")<BR>dealID = Request.QueryString("d")<BR>docTypeID = Request.QueryString("dtype")<BR><BR>set rsc = CreateObject("ADODB.RecordSet")<BR>sql = "sp1 " & dealID & ""<BR>rsc.Open sql, Application("XXXXX")<BR><BR>If rsc.EOF Then<BR> URL = "default.asp?c=access&r=upw"<BR> Response.Redirect URL<BR>Else<BR> companyName = rsc("CompanyName")<BR> shortDesc = rsc("ShortDesc")<BR> contactFirstName = rsc("contactFirstName")<BR> contactLastName = rsc("contactLastName")<BR> contactEmail = rsc("contactEmail")<BR> ppmPath = rsc("ppmPath")<BR> ppmSize = rsc("ppmSize")<BR> finPath = rsc("finPath")<BR> finSize = rsc("finSize")<BR> presPath = rsc("presPath")<BR> presSize = rsc("presSize")<BR> avPath = rsc("avPath")<BR> avSize = rsc("avSize")<BR> subsPath = rsc("subsPath")<BR> subsSize = rsc("subsSize") <BR> imgPath = rsc("imgPath")<BR>End If<BR>rsc.Close<BR>set rsc = Nothing<BR><BR><BR>set rsc = CreateObject("ADODB.RecordSet")<BR>rsc.CursorType = adOpenKeyset<BR>rsc.LockType = adLockOptimistic<BR>sql = "exec sp3"<BR>rsc.Open sql, Application("XXXXX")<BR><BR>rsc.AddNew<BR>rsc("ema il") = email<BR>rsc("agentID") = agentID<BR>rsc("dealID") = dealid<BR>rsc("docTypeID") = docTypeID<BR>rsc("requestDate") = Now<BR>rsc.Update<BR>rsc.Close<BR>set rsc = Nothing<BR><BR><BR>IF docTypeID = "av" THEN<BR> URL = avPath<BR>ELSEIF docTypeID = "fin" THEN<BR> URL = finPath<BR>ELSEIF docTypeID = "pp" THEN<BR> URL = ppmPath<BR>ELSEIF docTypeID = "sub" THEN<BR> URL = subsPath<BR>ELSEIF docTypeID = "ss" THEN<BR> URL = presPath<BR>END IF<BR><BR>Response.Redirect URL<BR>%&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts