Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| 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 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 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

 
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"
 
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?

 
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"




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





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