Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 October 26th, 2004, 12:05 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to Access via OLE-DB

I am getting an error when using the code from the book. I am trying to learn how to access a Microsoft Access database via my .asp page.

My code:
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data Source=Movie2000.mdb;" & _
               "Persist Security Info=False"

Generates the following Error.
Error Type:
Microsoft JET Database Engine (0x80004005)
Could not find file 'C:\WINDOWS\system32\Movie2000.mdb'.
/study/assignment9/connect.asp, line 25

The Movie2000.mdb is stored in the same folder as the .asp file.

Joe

Reply With Quote
  #2 (permalink)  
Old October 26th, 2004, 12:17 PM
Authorized User
 
Join Date: Oct 2004
Location: Austin, TX, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Joe-

If you don't specify a path, the Open uses whatever is the "current" path on the server. In this case, it looks like it thinks C:\Windows\System32 is the current path. Include the absolute path in your Data Source parameter, and it should work.


John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
Reply With Quote
  #3 (permalink)  
Old October 26th, 2004, 02:02 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does that mean I have to use the entire url when I upload the Access.mdb to the server?

Reply With Quote
  #4 (permalink)  
Old October 26th, 2004, 02:28 PM
Authorized User
 
Join Date: Oct 2004
Location: Austin, TX, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Uploading the data has nothing to do with it. Remember that ASP code runs on the server, so the Connection property must point to a location relative to the server. If the database is in the Databases folder on the D drive, then you must say:

  "Data Source=D:\Databases\Movie2000.mdb;"



John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
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
Access (.mdb) over network using Jet 4 OLE DB sajid_rauf Pro VB Databases 0 May 16th, 2007 07:41 AM
Access DB2 on AS/400 using IBM OLE DB Provider KiwiMark SQL Server 2005 2 February 16th, 2006 07:40 PM
Connecting to Access Db mattastic Classic ASP Databases 3 October 14th, 2004 02:32 AM
Connecting to Excel in Access OLE Object Mack Classic ASP Databases 0 October 8th, 2004 03:43 AM
Connecting to another Access db with different IP ckentebe Access VBA 3 April 21st, 2004 12:08 AM



All times are GMT -4. The time now is 03:08 AM.


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