473,392 Members | 1,319 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,392 software developers and data experts.

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 1735
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dan Sikorsky | last post by:
How do you use server.mappath to update a access database on a completely different computer? One of my websites needs to update a database on a completely different website. Example: My ASP...
24
by: Lovely Angel | last post by:
Dear Friends Hope you doing great. I have recently shifted to a webhost which is Using Windows 2003 and IIS 6. Now my application was working fine earlier but now I am facing this problem ...
7
by: A P | last post by:
I receive an error like this: Server.MapPath() error 'ASP 0172 : 80004005' Invalid Path /conn.asp, line 2 The Path parameter for the MapPath method must be a virtual path. A physical path...
4
by: Jack | last post by:
Hello, I have an application on my desktop where I have hardcoded the connection string. Now I need to move the application to our test webserver. Here I need to use the server.mappath method to...
6
by: sirius | last post by:
I have a simple database in ms access, one table with some 10-15 recordets. When creating web page in asp (vbscript) on my local machine, which displays the contents of access database, everything...
1
by: momo | last post by:
Hello Guys, I am getting this error " Control 'oGrid__ctl14__ctl1' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server." Here is my code and I don't know where...
1
by: gujarsachin2001 | last post by:
Hello friends, I have one folder Named as MainFolder on server. I have one more folder named as subfolder inside tht main folder.Now I want to save some pictures in tht folder but at runtime I m...
3
by: rn5a | last post by:
Server.MapPath returns the physical file path that corresponds to the specified virtual path whereas Request.MapPath maps the specified virtual path to a physical path. Assuming that a file named...
17
by: Anil Gupte | last post by:
I am using the following to try to connect to the database, but it does not seem to be working. Dim sConnString sConnString = "Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security...
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.