469,572 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

HOWTO: Server.MapPath to a different server computer

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 page is on http://www.websiteone.com and I want to update the
database on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath ( 'http://www.websitetwo.com/data/DB.mdb' );

// make up the connection string

var sConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0; ';

sConnectionString += 'Data Source=' + sDBPath;

When connecting, I get a "An invalid character was specified in the Path
parameter for the MapPath method" error message.
--
Dan Sikorsky, MSCS BSCE BAB

Jul 19 '05 #1
6 10272
Couldn't you use a DTS package in SQL 2000?
-----Original Message-----
How do you use server.mappath to update a access database on a completelydifferent computer? One of my websites needs to update a database on acompletely different website.

Example:
My ASP page is on http://www.websiteone.com and I want to update thedatabase on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath ( 'http://www.websitetwo.com/data/DB.mdb' );
// make up the connection string

var sConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0; ';
sConnectionString += 'Data Source=' + sDBPath;

When connecting, I get a "An invalid character was specified in the Pathparameter for the MapPath method" error message.
--
Dan Sikorsky, MSCS BSCE BAB

.

Jul 19 '05 #2
I don't think you can, if that's the only connection you have to the second
database.

I think what I would do, is have my asp page on website one, create
insert/update/delete statements and send them to my asp page on website two.
The page on website two, would then process the queries.

Another option, would be to have website one download the entire access
database locally and use it. Assuming of course that you just want to read
from the database.

"Dan Sikorsky" <ds****@gte.net> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
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 page is on http://www.websiteone.com and I want to update the
database on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath ( 'http://www.websitetwo.com/data/DB.mdb' );

// make up the connection string

var sConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0; ';

sConnectionString += 'Data Source=' + sDBPath;

When connecting, I get a "An invalid character was specified in the Path
parameter for the MapPath method" error message.
--
Dan Sikorsky, MSCS BSCE BAB

Jul 19 '05 #3
The o/p said they were using Access.

"GJones" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Couldn't you use a DTS package in SQL 2000?
-----Original Message-----
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 page is on http://www.websiteone.com and I want to

update the
database on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath

( 'http://www.websitetwo.com/data/DB.mdb' );

// make up the connection string

var sConnectionString

= 'Provider=Microsoft.Jet.OLEDB.4.0; ';

sConnectionString += 'Data Source=' + sDBPath;

When connecting, I get a "An invalid character was

specified in the Path
parameter for the MapPath method" error message.
--
Dan Sikorsky, MSCS BSCE BAB

.

Jul 19 '05 #4
I think you're right. I'll have to restructure my logic.

--
Dan Sikorsky, MSCS BSCE BAB
"Tom B" <sh*****@NOSPAMhotmail.com> wrote in message
news:uI**************@TK2MSFTNGP09.phx.gbl...
I don't think you can, if that's the only connection you have to the second database.

I think what I would do, is have my asp page on website one, create
insert/update/delete statements and send them to my asp page on website two. The page on website two, would then process the queries.

Another option, would be to have website one download the entire access
database locally and use it. Assuming of course that you just want to read from the database.

"Dan Sikorsky" <ds****@gte.net> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
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 page is on http://www.websiteone.com and I want to update the
database on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath ( 'http://www.websitetwo.com/data/DB.mdb' );
// make up the connection string

var sConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0; ';

sConnectionString += 'Data Source=' + sDBPath;

When connecting, I get a "An invalid character was specified in the Path
parameter for the MapPath method" error message.
--
Dan Sikorsky, MSCS BSCE BAB


Jul 19 '05 #5
"Dan Sikorsky" <ds****@gte.net> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
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 page is on http://www.websiteone.com and I want to update the
database on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath ( 'http://www.websitetwo.com/data/DB.mdb' );

// make up the connection string

var sConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0; ';

sConnectionString += 'Data Source=' + sDBPath;

When connecting, I get a "An invalid character was specified in the Path
parameter for the MapPath method" error message.


You can't. Don't use MapPath at all in this case, use a plain local or UNC
path instead.

var sDBPath = "C:\data\DB.mdb"

OR

var sDBPath = "\\yourserver\data\DB.mdb"

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #6
On Wed, 19 Nov 2003 19:11:31 -0500, "Dan Sikorsky" <ds****@gte.net>
wrote:
How do you use server.mappath to update a access database on a completely
different computer?
You can't. Server.Mappath is for the local file system.
One of my websites needs to update a database on a
completely different website.
So? You can't use Server.Mappath, but that doesn't mean you can't use
a UNC path. Although you will run into permission issues and need to
sort those out.
Example:
My ASP page is on http://www.websiteone.com and I want to update the
database on http://www.websitetwo.com

// where is the Access database?

var sDBPath = Server.MapPath ( 'http://www.websitetwo.com/data/DB.mdb' );
Might want to review the Server.Mappath method:

http://www.devguru.com/Technologies/...r_mappath.html
When connecting, I get a "An invalid character was specified in the Path
parameter for the MapPath method" error message.


Yup. That'll happen.

Jeff
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Topper | last post: by
14 posts views Thread by Lorenzo | last post: by
7 posts views Thread by CoolBreeze812 | last post: by
3 posts views Thread by rn5a | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.