Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Unspecified error


Message #1 by nd_taylor@b... on Tue, 12 Nov 2002 13:05:47
I am able to load my default page for my website which is connected to a 
database without any problems then when i go to another page which has a 
connection to the same page I get the Unspecified error come up.

I believe what is happening is the connection to the database is not 
closing properly and is not allowing it to connect again.

I use the following dns-less connection to connect to the DB and is in an 
include file.

<%
	Set Conn = Server.CreateObject("ADODB.Connection")
	Conn.ConnectionString = "DRIVER={Microsoft Access Driver 
(*.mdb)}; DBQ=" &_
	Server.MapPath("../database/database.mdb")
	Conn.Open
%>

Here is an example what what I use to get a recordset from the DB

<%
	sql = "select * FROM tblEvents WHERE fldId =" & request("id")
	Set objRS = Conn.Execute(sql)
%>

And then close my db connection using the following code

<%
objRS.Close
Set objRS = Nothing
	
Conn.close
Set Conn = Nothing
%>

If i leave the page for about 30secs then i can press the refresh and it 
works fine.

Any suggestions as to what i can do?

Any help would be gratefully appreciated

Nigel
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 13 Nov 2002 13:14:05 +1100
Use the OLEDB Provider, not the ODBC driver.

www.adopenstatic.com/faq/whyOLEDB.asp

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <nd_taylor@b...>
Subject: [access_asp] Unspecified error


: I am able to load my default page for my website which is connected to a
: database without any problems then when i go to another page which has a
: connection to the same page I get the Unspecified error come up.
:
: I believe what is happening is the connection to the database is not
: closing properly and is not allowing it to connect again.
:
: I use the following dns-less connection to connect to the DB and is in an
: include file.
:
: <%
: Set Conn = Server.CreateObject("ADODB.Connection")
: Conn.ConnectionString = "DRIVER={Microsoft Access Driver
: (*.mdb)}; DBQ=" &_
: Server.MapPath("../database/database.mdb")
: Conn.Open
: %>
:
: Here is an example what what I use to get a recordset from the DB
:
: <%
: sql = "select * FROM tblEvents WHERE fldId =" & request("id")
: Set objRS = Conn.Execute(sql)
: %>
:
: And then close my db connection using the following code
:
: <%
: objRS.Close
: Set objRS = Nothing
:
: Conn.close
: Set Conn = Nothing
: %>
:
: If i leave the page for about 30secs then i can press the refresh and it
: works fine.
:
: Any suggestions as to what i can do?
:
: Any help would be gratefully appreciated
:
: Nigel


  Return to Index