If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ADO connection on ASP Page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-04, 10:42
bpolunin bpolunin is offline
Registered User
 
Join Date: May 2003
Location: Atlanta, GA
Posts: 187
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.
Reply With Quote
  #2 (permalink)  
Old 03-06-04, 23:06
gyuan gyuan is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 03-08-04, 01:35
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
  #4 (permalink)  
Old 03-08-04, 08:30
bpolunin bpolunin is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 03-08-04, 08:35
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On