|
 |
asp_database_setup thread: Problems Connecting to Database
Message #1 by "Jeremy Howell" <sc6_9cc@h...> on Tue, 14 Aug 2001 14:11:16
|
|
I am having problems connecting to my database. I will work every once
and a while. I can run it now and it will work but it won't work for
another 5-10 minutes or so. My DSN Timeout Setting is 5 sec. After
connecting succesfully once i get Provider Error '80004005'. Unspecified
Error. Any help would be greatly appreciated.
Jeremy
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 15 Aug 2001 14:13:42 +1000
|
|
>> The error is on line 6
> How do you know? I didn't post any code
Exactly!
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Jeremy Howell" <sc6_9cc@h...>
Subject: [asp_database_setup] Problems Connecting to Database
: I am having problems connecting to my database. I will work every once
: and a while. I can run it now and it will work but it won't work for
: another 5-10 minutes or so. My DSN Timeout Setting is 5 sec. After
: connecting succesfully once i get Provider Error '80004005'. Unspecified
: Error. Any help would be greatly appreciated.
:
: Jeremy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by "Jeremy Howell" <sc6_9cc@h...> on Wed, 15 Aug 2001 13:18:58
|
|
I'm certain it's not the code but if you wish to have it here's the
connection lines that i'm using. I was thinking it was something set up
on the DSN or NT Server somewhere.
set custRS=server.createobject("ADODB.recordset")
custRS.open "Select * from Commercial", "DSN=customers"
> >> The error is on line 6
>
> > How do you know? I didn't post any code
>
> Exactly!
>
> Cheers
> Ken
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Jeremy Howell" <sc6_9cc@h...>
> Subject: [asp_database_setup] Problems Connecting to Database
>
>
> : I am having problems connecting to my database. I will work every once
> : and a while. I can run it now and it will work but it won't work for
> : another 5-10 minutes or so. My DSN Timeout Setting is 5 sec. After
> : connecting succesfully once i get Provider Error '80004005'.
Unspecified
> : Error. Any help would be greatly appreciated.
> :
> : Jeremy
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
Message #4 by "Ken Schaefer" <ken@a...> on Thu, 16 Aug 2001 11:12:25 +1000
|
|
OK the problem is being caused by one of two things (and you're wrong, it is
your code).
Firstly there are some problems with the Access ODBC Driver:
http://www.adopenstatic.com/faq/whyOLEDB.asp
Secondly, your code is opening an implicit connection to the database. Since
you have no reference to the connection object, you can't get rid of it, and
so it hangs around until ASP (if ever) finally disposes of it:
http://support.microsoft.com/support/kb/articles/Q191/5/72.ASP
I suggest you rewrite your code like so:
<%
strConnect = "...connection string here..."
strSQL = "...SQL statement here..."
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
Set objRS = Server.CreateObject("ADODB.Recordset"0
objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
...
objRS.close
Set objRS = Nothing
objConn.close
Set objConn = Nothing
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Jeremy Howell" <sc6_9cc@h...>
To: "ASP Database Setup" <asp_database_setup@p...>
Sent: Wednesday, August 15, 2001 1:18 PM
Subject: [asp_database_setup] Re: Problems Connecting to Database
: I'm certain it's not the code but if you wish to have it here's the
: connection lines that i'm using. I was thinking it was something set up
: on the DSN or NT Server somewhere.
:
:
: set custRS=server.createobject("ADODB.recordset")
: custRS.open "Select * from Commercial", "DSN=customers"
:
:
:
: > >> The error is on line 6
: >
: > > How do you know? I didn't post any code
: >
: > Exactly!
: >
: > Cheers
: > Ken
: >
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: > From: "Jeremy Howell" <sc6_9cc@h...>
: > Subject: [asp_database_setup] Problems Connecting to Database
: >
: >
: > : I am having problems connecting to my database. I will work every
once
: > : and a while. I can run it now and it will work but it won't work for
: > : another 5-10 minutes or so. My DSN Timeout Setting is 5 sec. After
: > : connecting succesfully once i get Provider Error '80004005'.
: Unspecified
: > : Error. Any help would be greatly appreciated.
: > :
: > : Jeremy
: >
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: >
|
|
 |