Advertisements

Note that unless you've configured IIS so that read-access is denied to that
file or directory via HTTP, anyone in the world can download your database.
(Assuming that directory is a WWW-published directory.)

Ray at work

<> wrote in message
news:...
> Microsoft has a tutorial for ASP. There is a connection string in the
> code
> as follows:
>
> DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\
>
> How do I change this statement once I move the page to my web server?
> I
> have the database in my root folder.
>
>
> Thanks
>

As an explanation, Server.MapPath finds the actual physical path on
the system to the file beginning at the root of the web. So if your
file was physically at:

c:\inetpub\wwwroot\subfolder1\application\database.mdb

and your site's root was at:

c:\inetpub\wwwroot\

then the MapPath argument would be:

("/subfolder1/application/database.mdb")

Using MapPath ensure that the structure of your web site is followed,
no matter where the root of your site happens to be on the server.
Your ISP could have your root at H:\Webroots\BasicHostingPlans\Bob\
and as long as your structure of your site is the same as on your
home/development system you don't need to change the code.

Jeff

>Note that unless you've configured IIS so that read-access is denied to that
>file or directory via HTTP, anyone in the world can download your database.
>(Assuming that directory is a WWW-published directory.)
>
>Ray at work
>
>
><> wrote in message
>news:...
>> Microsoft has a tutorial for ASP. There is a connection string in the
>> code
>> as follows:
>>
>> DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\
>>
>> How do I change this statement once I move the page to my web server?
>> I
>> have the database in my root folder.
>>
>>
>> Thanks
>>
>

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!