placed DB outside the web root ...now what?

C

cooldv

After talking (emailing) to my webhoster, i have placed my access DB
in a folder outside the root directory folder; and they gave me a
*path.asp* file to put in my root directory folder. ** This webhoster
is a real specimen! He/she refuses to provide further support saying
it is a script debugging issue***
I need help from ya'll gurus!!!!!!

1a. The path.asp file has only 1 line code: <% = Server.MapPath(".")
%>

1b. Running the path.asp file (via http://........./path.asp) returns
this in the browser window: f:\names\mywebsite.com\rootfolder

2. the structure of my ftp access is like this:
ftp.mywebsite....com
- mywebsite....com (folder)
rootfolder (this is the root directory folder)
secure (folder)

Now, all the asp files (and path.asp file) are in the rootfolder and
the access DB is in the secure folder.

3a. What path to the database do i write in my asp file?

set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("database.mdb")
conn.Open DSNtemp

3b. If i run my asp file with this above code, i get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0xd9c Thread
0xdf0 DBC 0x22b6024 Jet'.

/aspfile.asp, line 74
(line 74 is the conn.open DSNtemp)
 
R

Ray at

Hi cooldv,

If your host won't tell you the physical path on the server, you can get it
like this:

<%=Request.ServerVariables("APPL_PHYSICAL_PATH")%>

If that returns something like:

D:\Inetpub\wwwroot\youraccount\mywebsite.com

That would put your mdb file in
D:\Inetpub\wwwroot\youraccount\secure

So you'd use a connection string like:

DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\Inetpub\wwwroot\youraccount\secure\database.mdb;"

That's an OLE DB string, which will solve the error you indicated if the
path wasn't the issue.

Ray at work
 
J

Jeff Cochran

After talking (emailing) to my webhoster, i have placed my access DB
in a folder outside the root directory folder; and they gave me a
*path.asp* file to put in my root directory folder. ** This webhoster
is a real specimen! He/she refuses to provide further support saying
it is a script debugging issue***

Well... It *is*.
I need help from ya'll gurus!!!!!!

1a. The path.asp file has only 1 line code: <% = Server.MapPath(".")
%>

1b. Running the path.asp file (via http://........./path.asp) returns
this in the browser window: f:\names\mywebsite.com\rootfolder

Of course it does. :)

All that code does is return the physoical path to the folder you run
the code from.
2. the structure of my ftp access is like this:
ftp.mywebsite....com
- mywebsite....com (folder)

Now, all the asp files (and path.asp file) are in the rootfolder and
the access DB is in the secure folder.

3a. What path to the database do i write in my asp file?

Looks like f:\names\mywebsite.com\secure from what you've posted.
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("database.mdb")
conn.Open DSNtemp

That shouldn't find the MDB file.
3b. If i run my asp file with this above code, i get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0xd9c Thread
0xdf0 DBC 0x22b6024 Jet'.

Not related to the pathing I suspect, but start here for that one:

Why do I get database-related 80004005 errors?
http://www.aspfaq.com/show.asp?id=2009

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top