469,331 Members | 5,937 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

Server.MapPath connection string question.

I have two sites:

www.site_A.com & www.site_A_news.com

Site_A is in d:\webs\site_a & uses an Access DB in
d:\webs\site_a\data\db.mdb

Site_A_news is in d:\webs\site_a\site_a_news also requires access to
that Access Database.

How should I setup the connection string so both webs can share the same
database?
Jul 19 '05 #1
7 1597
I assume this is the same server since you didn't say otherwise.
site_a should continue as is.
site_a_news should use D:\webs\site_a\data\db.mdb in its connection string.

A different (likely better) solution would be to move the database to
d:\database\db.mdb and both site_a and site_a_news can get to it from there.

MSDE would likely be even better.

TomB
"Dave" <1@1.ca> wrote in message
news:uC****************@TK2MSFTNGP09.phx.gbl...
I have two sites:

www.site_A.com & www.site_A_news.com

Site_A is in d:\webs\site_a & uses an Access DB in
d:\webs\site_a\data\db.mdb

Site_A_news is in d:\webs\site_a\site_a_news also requires access to
that Access Database.

How should I setup the connection string so both webs can share the same
database?

Jul 19 '05 #2
Yes, same server - sorry. And I agree, MSDE would be better, but I do
not have that option at the moment.

Right now, I have both setup to use the full path
D:\webs\site_a\data\db.mdb in their connection strings...

Any reason why I should NOT do that?

Why do many example of DSN Less connection strings use Server.MapPath?

Any performance gains by doing that? Security considerations?

TomB wrote:
I assume this is the same server since you didn't say otherwise.
site_a should continue as is.
site_a_news should use D:\webs\site_a\data\db.mdb in its connection string.

A different (likely better) solution would be to move the database to
d:\database\db.mdb and both site_a and site_a_news can get to it from there.

MSDE would likely be even better.

TomB
"Dave" <1@1.ca> wrote in message
news:uC****************@TK2MSFTNGP09.phx.gbl...
I have two sites:

www.site_A.com & www.site_A_news.com

Site_A is in d:\webs\site_a & uses an Access DB in
d:\webs\site_a\data\db.mdb

Site_A_news is in d:\webs\site_a\site_a_news also requires access to
that Access Database.

How should I setup the connection string so both webs can share the same
database?


Jul 19 '05 #3
Yes, same server - sorry. And I agree, MSDE would be better, but I do
not have that option at the moment.

Right now, I have both setup to use the full path
D:\webs\site_a\data\db.mdb in their connection strings...

Any reason why I should NOT do that?

Why do many example of DSN Less connection strings use Server.MapPath?

Any performance gains by doing that? Security considerations?

TomB wrote:
I assume this is the same server since you didn't say otherwise.
site_a should continue as is.
site_a_news should use D:\webs\site_a\data\db.mdb in its connection string.

A different (likely better) solution would be to move the database to
d:\database\db.mdb and both site_a and site_a_news can get to it from there.

MSDE would likely be even better.

TomB
"Dave" <1@1.ca> wrote in message
news:uC****************@TK2MSFTNGP09.phx.gbl...
I have two sites:

www.site_A.com & www.site_A_news.com

Site_A is in d:\webs\site_a & uses an Access DB in
d:\webs\site_a\data\db.mdb

Site_A_news is in d:\webs\site_a\site_a_news also requires access to
that Access Database.

How should I setup the connection string so both webs can share the same
database?


Jul 19 '05 #4
The downside to having your database within your site, is that a user could
type in the url to the database and download it.
http://site_a/data/db.mdb
To fix, you can rename the database db.asp

I think the main reasons for using Server.MapPath are
a) if it's sample code they don't know where you are going to put it
b) if you move the site to a new server, or a new directory, the link is
relative so it won't break.

Tom B

"Dave" <1@1.ca> wrote in message
news:uj**************@tk2msftngp13.phx.gbl...
Yes, same server - sorry. And I agree, MSDE would be better, but I do
not have that option at the moment.

Right now, I have both setup to use the full path
D:\webs\site_a\data\db.mdb in their connection strings...

Any reason why I should NOT do that?

Why do many example of DSN Less connection strings use Server.MapPath?

Any performance gains by doing that? Security considerations?

TomB wrote:
I assume this is the same server since you didn't say otherwise.
site_a should continue as is.
site_a_news should use D:\webs\site_a\data\db.mdb in its connection string.
A different (likely better) solution would be to move the database to
d:\database\db.mdb and both site_a and site_a_news can get to it from there.
MSDE would likely be even better.

TomB
"Dave" <1@1.ca> wrote in message
news:uC****************@TK2MSFTNGP09.phx.gbl...
I have two sites:

www.site_A.com & www.site_A_news.com

Site_A is in d:\webs\site_a & uses an Access DB in
d:\webs\site_a\data\db.mdb

Site_A_news is in d:\webs\site_a\site_a_news also requires access to
that Access Database.

How should I setup the connection string so both webs can share the same
database?


Jul 19 '05 #5
Thanks Tom.

One final question.. how could the web user download the db? How would
(could) they find out the path?

TomB wrote:
The downside to having your database within your site, is that a user could
type in the url to the database and download it.
http://site_a/data/db.mdb
To fix, you can rename the database db.asp

I think the main reasons for using Server.MapPath are
a) if it's sample code they don't know where you are going to put it
b) if you move the site to a new server, or a new directory, the link is
relative so it won't break.

Tom B

"Dave" <1@1.ca> wrote in message
news:uj**************@tk2msftngp13.phx.gbl...
Yes, same server - sorry. And I agree, MSDE would be better, but I do
not have that option at the moment.

Right now, I have both setup to use the full path
D:\webs\site_a\data\db.mdb in their connection strings...

Any reason why I should NOT do that?

Why do many example of DSN Less connection strings use Server.MapPath?

Any performance gains by doing that? Security considerations?

TomB wrote:

I assume this is the same server since you didn't say otherwise.
site_a should continue as is.
site_a_news should use D:\webs\site_a\data\db.mdb in its connection
string.
A different (likely better) solution would be to move the database to
d:\database\db.mdb and both site_a and site_a_news can get to it from
there.
MSDE would likely be even better.

TomB
"Dave" <1@1.ca> wrote in message
news:uC****************@TK2MSFTNGP09.phx.gbl. ..
I have two sites:

www.site_A.com & www.site_A_news.com

Site_A is in d:\webs\site_a & uses an Access DB in
d:\webs\site_a\data\db.mdb

Site_A_news is in d:\webs\site_a\site_a_news also requires access to
that Access Database.

How should I setup the connection string so both webs can share the same
database?


Jul 19 '05 #6
Usually just by sheer luck.
However, other things can happen.

a) Perhaps a user hits an error and the error message says something that
gives it away.
b) Your asp page doesn't get processed for some reason, and the source code
is displayed instead.
c) You accidentally allow directory browsing and don't have a default page.
d) Good guesswork.
e) Once a person posted a question on a newsgroup with their real email
address (the usual NOSPAM was in there) and because of the information they
provided, their database could easily have been downloaded. Note I've seen
this with SQL too, people posting straight from their source with IP of
their server, username and password. Invariably it's sa.

All in all it's pretty unlikely to happen. But it could.
TomB
"Dave" <1@1.ca> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Thanks Tom.

One final question.. how could the web user download the db? How would
(could) they find out the path?

TomB wrote:
The downside to having your database within your site, is that a user could type in the url to the database and download it.
http://site_a/data/db.mdb
To fix, you can rename the database db.asp

I think the main reasons for using Server.MapPath are
a) if it's sample code they don't know where you are going to put it
b) if you move the site to a new server, or a new directory, the link is
relative so it won't break.

Tom B

"Dave" <1@1.ca> wrote in message
news:uj**************@tk2msftngp13.phx.gbl...
Yes, same server - sorry. And I agree, MSDE would be better, but I do
not have that option at the moment.

Right now, I have both setup to use the full path
D:\webs\site_a\data\db.mdb in their connection strings...

Any reason why I should NOT do that?

Why do many example of DSN Less connection strings use Server.MapPath?

Any performance gains by doing that? Security considerations?

TomB wrote:
I assume this is the same server since you didn't say otherwise.
site_a should continue as is.
site_a_news should use D:\webs\site_a\data\db.mdb in its connection


string.
A different (likely better) solution would be to move the database to
d:\database\db.mdb and both site_a and site_a_news can get to it from


there.
MSDE would likely be even better.

TomB
"Dave" <1@1.ca> wrote in message
news:uC****************@TK2MSFTNGP09.phx.gbl. ..
>I have two sites:
>
>www.site_A.com & www.site_A_news.com
>
>Site_A is in d:\webs\site_a & uses an Access DB in
>d:\webs\site_a\data\db.mdb
>
>Site_A_news is in d:\webs\site_a\site_a_news also requires access to
>that Access Database.
>
>How should I setup the connection string so both webs can share the same>database?


Jul 19 '05 #7
Good points, thanks Tom. I'll adjust accordingly :)

TomB wrote:
Usually just by sheer luck.
However, other things can happen.

a) Perhaps a user hits an error and the error message says something that
gives it away.
b) Your asp page doesn't get processed for some reason, and the source code
is displayed instead.
c) You accidentally allow directory browsing and don't have a default page.
d) Good guesswork.
e) Once a person posted a question on a newsgroup with their real email
address (the usual NOSPAM was in there) and because of the information they
provided, their database could easily have been downloaded. Note I've seen
this with SQL too, people posting straight from their source with IP of
their server, username and password. Invariably it's sa.

All in all it's pretty unlikely to happen. But it could.
TomB
"Dave" <1@1.ca> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Thanks Tom.

One final question.. how could the web user download the db? How would
(could) they find out the path?

TomB wrote:
The downside to having your database within your site, is that a user
could
type in the url to the database and download it.
http://site_a/data/db.mdb
To fix, you can rename the database db.asp

I think the main reasons for using Server.MapPath are
a) if it's sample code they don't know where you are going to put it
b) if you move the site to a new server, or a new directory, the link is
relative so it won't break.

Tom B

"Dave" <1@1.ca> wrote in message
news:uj**************@tk2msftngp13.phx.gbl...
Yes, same server - sorry. And I agree, MSDE would be better, but I do
not have that option at the moment.

Right now, I have both setup to use the full path
D:\webs\site_a\data\db.mdb in their connection strings...

Any reason why I should NOT do that?

Why do many example of DSN Less connection strings use Server.MapPath?

Any performance gains by doing that? Security considerations?

TomB wrote:

>I assume this is the same server since you didn't say otherwise.
>site_a should continue as is.
>site_a_news should use D:\webs\site_a\data\db.mdb in its connection

string.
>A different (likely better) solution would be to move the database to
>d:\database\db.mdb and both site_a and site_a_news can get to it from

there.
>MSDE would likely be even better.
>
>TomB
>
>
>"Dave" <1@1.ca> wrote in message
>news:uC****************@TK2MSFTNGP09.phx.gbl. ..
>
>
>
>>I have two sites:
>>
>>www.site_A.com & www.site_A_news.com
>>
>>Site_A is in d:\webs\site_a & uses an Access DB in
>>d:\webs\site_a\data\db.mdb
>>
>>Site_A_news is in d:\webs\site_a\site_a_news also requires access to
>>that Access Database.
>>
>>How should I setup the connection string so both webs can share the
same
database?
>
>
>


Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by sirius | last post: by
1 post views Thread by momo | last post: by
3 posts views Thread by rn5a | last post: by
17 posts views Thread by Anil Gupte | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.