Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    Atlanta, GA
    Posts
    187

    Unanswered: ADO connection on ASP Page

    Hi,
    I was wondering if there is a way to keep an ADO connection open when a page refreshes or going to a next page.

    If there is any way to do it, please let me know and some code would be helpfull.

    Thanks.

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    I'm not sure what you want. The connection on the page will be reopened when you refresh the page. But if you leave the current page the open connection can not be kept to the next page.

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    <<
    I was wondering if there is a way to keep an ADO connection open when a page refreshes or going to a next page.
    >>

    That's basically not done with Web pages.

    Generally speaking you can pass variables from page to page by:

    1) Posting form fields from one page to the next (or to the same page) and on the page to retrieve the value strLName = Request.Form("LName")

    2) Using a querystring such as Response.Redirect "login.asp?lname=smith&fname=tom" and on the page to retrieve the values strLName = Request.QueryString("lname") and strFName = Request.QueryString("fname")

    3) Using session variables such as Session("LName") = "Smith" and on the page to retrieve the value strLName = Session("LName")
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  4. #4
    Join Date
    May 2003
    Location
    Atlanta, GA
    Posts
    187
    Thanks guy's. I didn't think that was possible, but was worth trying.
    The problem I have is on the first page a customer filles out a form, clicks submit. The submition to the DB happens on the next page. Then there is more stuff to fill out and click submit again, the info gets passed in and goes on to the 3rd paged. Here is where the problem is. If the customer presses the back button to the 2nd page, the call to submit the info is going to happend again.
    How to avoid this and not have a bunch of variables going from page to page?

    Thanks.

  5. #5
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Well you could post the pages to themselves, store the info into session variables (perhaps assuming the site is a low traffic site as most sites are), and then redirect to the next page:

    ASP Design Tips - Post Back Page
    http://www.bullschmidt.com/devtip-postbackpage.asp
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

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