Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 November 5th, 2003, 02:25 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to costrega Send a message via AIM to costrega
Default DB Connection not working XP

The following code is erroring out on my Windows XP machine when trying to access a MS Access 2000 database.

Dim objConn
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
                    "Data Source = C:\Datastores\Home Notes.mdb"

The error that I'm getting is:
Error Type:
Microsoft JET Database Engine (0x80004005)
Unspecified error
/project/Datastore.asp, line 4

Line 4 is the objConn.Open statement.

I tested this code out on a Windows 2000 machine and it runs fine. I have also verified that the IUSR_xxxxx account has write access to the folder where the database is stored.

Can any one help.

Thanks

CO



 
Old November 5th, 2003, 03:32 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hmmm, odd. This should work.

What are the access permissions for the database and the folder (Other that write access for the Datastores folder)?

Under what account is IIS running? Are you using anonymous access? If not the logged on user needs permissions as well.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 5th, 2003, 03:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Isn't it that Open is a method and not a property, and therefore should be like this...
Code:
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source = C:\Datastores\Home Notes.mdb"
Jacob.

 
Old November 5th, 2003, 03:42 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Whoops, missed that.

Funny things is, I pasted the sample code in a test page, followed by:

If objConn.State = adStateOpen Then
  Response.Write("Open")
Else
  Response.Write("Closed")
End If

and it wrote Open......

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 5th, 2003, 03:45 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to costrega Send a message via AIM to costrega
Default

Both IUSR and the account that I'm logged with have full access to the database folder and the database file. There is not any security set up on the database it's self. I ever tried logged in as the workstation administrator and it still is not working.



 
Old November 6th, 2003, 12:35 AM
Friend of Wrox
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: La Jolla, CA, USA.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you verified that you have Jet 4.0 installed on your machine?
As an alternate, please give this connection string (ODBC) a try:

For Standard Security:

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq=C:\Datastores\Home Notes.mdb;" & _
           "Uid=admin;" & _
           "Pwd="

Found at:
http://www.able-consulting.com/ado_conn.htm


 
Old November 11th, 2003, 06:16 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You dont have jetinstalled in your machine. i had the same problem. When i tested my kode it did not work, but it worked great after i uploded it to brinkster
ayhan
 
Old November 11th, 2003, 06:18 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One more thing. You may have put wrong path dor your db. Check it again and put _ between home and notes. make the same changes in your file db section




Similar Threads
Thread Thread Starter Forum Replies Last Post
Working around DB Nulls chroniclemaster1 ASP.NET 2.0 Basics 2 February 27th, 2008 03:11 AM
Connection between Access XP and Oracle Tachyophan Access 1 February 14th, 2005 10:45 AM
MSDE Connection not working Phil Williams MySQL 3 March 18th, 2004 04:11 AM
Locks on my access db in win xp patricolsson Classic ASP Databases 6 December 17th, 2003 09:31 AM
Working with Access DB stu9820 ASP.NET 1.0 and 1.1 Basics 2 September 26th, 2003 08:11 AM





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