Provider error '80004005' in ASP page using Access database

I have an ASP page that performs a SQL search in an Access database.  I enter a search term and it works once.  Then I hit the back button and try again and it gives me the below error.
Provider error '80004005' 
 
Unspecified error 
 
/process.asp, line 17

Open in new window

Tony789Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tony789Author Commented:

set conn = server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DSN=Test.dsn"
conn.open  <--------------------------------------Line 17
 
set rs = server.createobject("ADODB.Recordset")
rs.Open "Table1", conn, , , adCmdTable
bolFound=False
 
set rs1 = server.createobject("ADODB.Recordset")
rs1.Open "Table2", conn, , , adCmdTable

Open in new window

0
Tony789Author Commented:
I have also closed the recordsets and connection.
0
hieloCommented:
Instead of using a DSN, use a DSN-less connection:

set conn = server.CreateObject("ADODB.Connection")
conn.open("Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("test.mdb"))
set rs = server.createobject("ADODB.Recordset")
...
You would need to provide the correct db name.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Tony789Author Commented:
I have been using DSN connections before and have never encountered this problem.  What is causing this now?
0
hieloCommented:
Not sure what would be the cause. The following article outlines quite a few:
http://tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors.html

FYI: Some time ago I ran into this:
http://www.powerasp.com/content/database/dsn_vs_dnsless.asp

among others, and have not used DSN since.
0
hieloCommented:
Out of curiosity, see try changing this:
set conn = server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DSN=Test.dsn"

to this:
set conn = server.CreateObject("ADODB.Connection")
conn.Mode = 3
conn.ConnectionString = "DSN=Test.dsn"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tony789Author Commented:
Awesome!  I added conn.Mode=3 and it is working correctly.

Thanks for your help.
0
Tony789Author Commented:
hielo,

Sometimes it works when I have conn.Mode=3 but sometimes it suddenly fails.  Then I remove conn.Mode=3 and it works again correctly.

Any suggestions?

Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.