This topic is locked

database outside wwwroot?

2/8/2004 1:59:57 PM
ASPRunnerPro General questions
B
bennettsw author

I'm test driving ASPrunner (and am new to ASP and other technologies), so please forgive me if this is a silly question!
I an access database generated by a 3rd party application that I would like to update over the Internet. My web server is running Windows 2003 Server.
At first, I had my database outside of /inetpub/wwwroot. This worked fine, until I tried to save an update - at which time I received a "'Must Use an Updateable Query' Error". A howto article(http://www.xlinesoft.com/asprunner/faq.htm#updatesyntax) states:
"This error can also occur when the database is located outside of the inetpub/wwwroot directory. Though the information is still able to be viewed and searched, it cannot be updated unless it is in the wwwroot directory"
Sure enough, if I put the databse in wwwroot, things work fine.
I have 2 questions:

  1. Is there a way to have the database outside of wwwroot, and still be able to update it?
  2. If I must keep the database within wwwroot, how can I set permissions to maximimze the security of the database? For example, I don't want people to be able to grab the entire database...
    Thanks!

    Bradley Bennett

Sergey Kornilov admin 2/9/2004

Bradley,
sure you can put your database outside WWWROOT. Please tell me full path to your database and full path to ASP files on the server and I'll post connectiong string that you need to use.

B
bennettsw author 2/9/2004

Sure:

The database is located in c:\database\Lead.mdb

The ASP files are located in c:\inetpub\wwwroot\Leads
Thanks!

Sergey Kornilov admin 2/9/2004

Bradley,
First of all you can use hardcoded path to your database:

<%

strConnection = "Provider=MSDataShape;DBQ=c:\database\Lead.mdb;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;"

%>


also you can use relative path:

<%

strConnection = "Provider=MSDataShape;DBQ=" & server.mappath("..\..\..\database\lead.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;"

%>


Both methods should work fine.