ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 9th, 2003, 04:40 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 29 m 2 sec
Reputation Power: 5
Database connection errors..time-out?

Hi, I am what you call a total newbie to ASP but it is very exciting when you make your scripts work! Ive learned amny things from you guys on this forum but now i am a little bit stuck...

Anyway my problem is:

I made an ASP page containing DSN-less connection data. I now use this page as a FILE INCLUDE item at the top of all my other ASP pages which need to connect to my database.

This all works fine the first time you load the page i.e. the connection is made and the database contents are displayed on the screen. However, if I press the refresh button, the browser displays an error message saying there is now something wrong with my database connect ASP page (the page which I "include" in all the other ASP pages).

If I then wait a couple of minutes and then press refresh it works again! But then if you press refresh again it wont work unless you wait another couple of minutes etc etc etc.....

Could anyone help me with this problem? It is seriously eating up all my precious developing time! hehe...By the way im using IIS 6.0 on Windows Server 2003 Standard Edition. I created a new new sitein the IIS manager and left all the settings as they were.

MANY thanks for any help! It is very much appreciated.

Seb

Reply With Quote
  #2  
Old August 9th, 2003, 06:15 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
do you close the connection and any recordset objects? are you properly destroying them? can you post the code you use to open the connection? can you post the exact error and what it occurs on?
__________________
Programmer's Corner

Reply With Quote
  #3  
Old August 9th, 2003, 08:17 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 29 m 2 sec
Reputation Power: 5
Yeah no problem. First of all, here is the ASP page with the connection data within:

<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=E:\PS2 Browser\faves.mdb"
objConn.Open
%>


Now any page I use this code in is acheived by using the include file syntax. Each page has what I assume is the appropriate code to close the connections after they are used. Here is an example of a page which works with the connection, but doesnt work again when you press refresh:

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual="/adovbs.inc"-->
<!--#include file="dataConnect.asp"-->
<%

Dim objRS, saveURL, saveName, bootMe
bootMe = "faves.asp"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "tblURL", objConn, , adLockOptimistic, adCmdTable

saveURL = Request.Form("saveURL")
saveName = Request.Form("saveName")



Do While Not objRS.EOF

If objRS("urlName") = "empty" THEN
objRS("urlAddress") = saveURL
objRS("urlName") = saveName
objRS.Update
Response.Redirect bootMe

End If

objRS.Movenext

Loop

objRS.Close
Set objRS = Nothing

objConn.Close
Set objConn = Nothing

%>

Thanks for your time.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Database connection errors..time-out?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway