Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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



Reply With Quote
  #2 (permalink)  
Old November 5th, 2003, 03:32 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #3 (permalink)  
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.

Reply With Quote
  #4 (permalink)  
Old November 5th, 2003, 03:42 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #5 (permalink)  
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.



Reply With Quote
  #6 (permalink)  
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


Reply With Quote
  #7 (permalink)  
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
Reply With Quote
  #8 (permalink)  
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:07 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.