Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 13th, 2003, 11:20 AM
Authorized User
Join Date: Jun 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vinyl-junkie
Default Database Connection Problem

In the last several days, my database has been down several times with the following error:

Microsoft JET Database Engine error '80004005'

Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

In searching the archives for this forum, I found this thread:

What it suggested was:
delete and re-add the DSN (I tried that and it didn't work)


Use an OLEDB connection, and referred you to this URL:

I tried that, as follows:

strDBPath = Server.MapPath("/database/CDTrust.mdb")
CONN_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "; "

Still got the same error. Now, after turning in a support ticket to my web host (again!) they tell me they converted my database to Access 2002 to solve the problem (it's presently Access 97 on my PC).

Here are my questions:

(1) Isn't there a better way to solve this problem?

(2) Does this mean that they'll have to convert it to 2002 every single time I upload a new version of the database? At least, that is, until I'm able to do the conversion myself (I don't have 2002).

Thanks in advance for any and all insight and help. :)

Pat Wong
http://www.napathon.net/ - Music Around The World
For collecting tips, trade and want lists, album reviews and more.
Pat Wong
http://www.napathon.net/ - Music Around The World
For collecting tips, trade and want lists, album reviews and more.
Old October 14th, 2003, 11:45 PM
Friend of Wrox
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran

Hi vinyl-junkie

First Yourwant to Write this query to global.asa
Sub Application_OnStart
        Application("Cnn_ConnectionString") = "DSN=CDTrust;DBQ=c:\database\CDTrust.mdb;DriverId= 281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"
        Application("Cnn_ConnectionTimeout") = 15
        Application("Cnn_CommandTimeout") = 30
        Application("Cnn_CursorLocation") = 3
        Application("Cnn_RuntimeUserName") = ""
        Application("Cnn_RuntimePassword") = ""
End Sub
and make a DSN (name:"CDTrust")

1.Open the ODBC icon in your Control Panel.
2.Choose the System DSN tab.
3.Click on Add in the System DSN tab.
4.Select the Microsoft Access Driver. Click Finish.
5.In the next screen, click Select to locate the database.
6.Give the database a Data Source Name (DSN).
7.Click OK.
then u can write a asp page
set cnn=Server.CreateObject("ADODB.connection")
cnn.Open Application("Cnn_connectionstring")
set rs=Server.CreateObject("ADODB.recordset")
sql= "select * FROM tablename "
rs.Open sql,cnn,1,3

Old June 2nd, 2008, 03:18 AM
fyz fyz is offline
Registered User
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Maybe you need some professional services. I think you can try a utility called Advanced Access Repair to repair your Access MDB file. It works rather well for my corrupt Access MDB files. Its web address is http://www.datanumen.com/aar/

Just post to hope this still can help.


Similar Threads
Thread Thread Starter Forum Replies Last Post
[?] A database connection problem Aritra ASP.NET 1.0 and 1.1 Basics 3 August 26th, 2008 02:19 AM
Database Connection Problem murali_vijaya JSP Basics 1 August 5th, 2006 10:10 AM
access database connection problem shaileshk ADO.NET 6 July 5th, 2005 03:30 AM
database connection problem farsfar2 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 March 14th, 2005 06:52 AM
Database Connection Problem Wolfgang_nl Crystal Reports 0 July 19th, 2004 01:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.