473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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)
Jul 19 '05 #1
2 2769
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\datab ase.mdb;"

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

Ray at work


"cooldv" <md**@hotmail.com> wrote in message
news:d3**************************@posting.google.c om...
After talking (emailing) to my webhoster, i have placed my access DB
in a folder outside the root directory folder; 3a. What path to the database do i write in my asp file?

Jul 19 '05 #2
On 24 Sep 2003 18:06:56 -0700, md**@hotmail.com (cooldv) wrote:
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)
>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?


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
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug | last post by:
I have a website I am trying to develop using PHP and Dreamweaver. I also have a library of PHP code which includes the username and password to get in the database. I would like to put this...
4
by: cooldv | last post by:
i learnt from *Ken Schaefer's* website that for security reasons, u should put your DB outside the website root directory. this is his webpage -...
1
by: Kelly | last post by:
hi all, it's me again. i'm using ASP.NET Web Application, using a "File Field"component under HTML tab and i do a right click on the component and select "Run As Server Control". This was done...
12
by: Jon Maz | last post by:
Hi All, I would like to have the following folder structure for an asp.net website: MasterFolder |---\AppRoot | --- webform.aspx | --- web.config | --- global.asax
0
by: DotNetJunkies User | last post by:
Hi All I am developing a site using ASP.Net I want to develop a site that generates forms ( textbox,check boxes etc) automatically ie is from database itself depending on the no of rows in the...
2
by: Oleg | last post by:
I need to configure my web application to see a folder outside it's root. I know I need to configure my web.config file, but don't know how. Can you help?
2
by: gurnandank | last post by:
Hi, I have a web application which uses SSL on one the folders. When I developed application the set up was webroot and under that folder called 'secure'. My ISP has provided a folder called...
19
by: SteveT | last post by:
Is it possible to have an include file that resides outside of the web site parent folder? For instance, lets say you have several websites under Inetpub/global/websites/ but the include file is...
5
by: OK | last post by:
I am using an image control to display some images within a virtual map (ImagesRoot in IIS) outside of the web root in my vb asp.net application. How should I code the imageurl property to have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.