p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP 3.0 (http://p2p.wrox.com/forumdisplay.php?f=27)
-   -   Database Location (http://p2p.wrox.com/showthread.php?t=9584)

egerdj February 19th, 2004 10:09 PM

Database Location
Have downloaded Movie2000.mdb (Access97) from wrox site. Created asp file from book. I am using an ISP's site (Earthlink) to run these codes. Even though I have uploaded both the database and the asp file to the same directory, I still get a location error even though I have entered the location as "Data Source=Movies2000.mdb", without any upper directories. The error, as follows seems to be a default. Is there a specific place the database must be?

Microsoft JET Database Engine error '80004005'
Could not find file 'C:\WINNT\system32\Movie2000.mdb'.
/asp_scripts/database1.asp, line 24

Imar February 20th, 2004 04:27 AM

Hi there,

If you don't specify a path for the database, the server will assume the "current folder" which, in the case of ASP Scripts, is the System32 folder.

You can use Server.MapPath to transform a virtual location to a fixed location:

"Data Source=" & Server.MapPath("Movies2000.mdb")

this will return something like c:\inetpub\wwwroot\YourAccountName\Movies2000.mdb which is the physical location of the file.



Imar Spaanjaars
Everyone is unique, except for me.

All times are GMT -4. The time now is 07:37 AM.

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