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

HOWTO: Server.MapPath to a different server computer by GJones

GJones
Wed Nov 19 18:50:46 CST 2003

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
>
>
>
>.
>

Re: HOWTO: Server.MapPath to a different server computer by Tom

Tom
Wed Nov 19 20:26:55 CST 2003

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" <dsikor@gte.net> wrote in message
news:u4bYYrvrDHA.1760@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
>
>
>



Re: HOWTO: Server.MapPath to a different server computer by Tom

Tom
Wed Nov 19 20:27:16 CST 2003

The o/p said they were using Access.

"GJones" <anonymous@discussions.microsoft.com> wrote in message
news:077201c3af00$5595fe60$a101280a@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
> >
> >
> >
> >.
> >



Re: HOWTO: Server.MapPath to a different server computer by Dan

Dan
Thu Nov 20 08:01:51 CST 2003

I think you're right. I'll have to restructure my logic.

--
Dan Sikorsky, MSCS BSCE BAB


"Tom B" <shuckle@NOSPAMhotmail.com> wrote in message
news:uIkHB3wrDHA.2364@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" <dsikor@gte.net> wrote in message
> news:u4bYYrvrDHA.1760@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
> >
> >
> >
>
>



Re: HOWTO: Server.MapPath to a different server computer by Tom

Tom
Thu Nov 20 08:03:55 CST 2003

"Dan Sikorsky" <dsikor@gte.net> wrote in message
news:u4bYYrvrDHA.1760@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/windowsserver2003/community/centers/iis/




Re: HOWTO: Server.MapPath to a different server computer by jcochran

jcochran
Thu Nov 20 08:17:52 CST 2003

On Wed, 19 Nov 2003 19:11:31 -0500, "Dan Sikorsky" <dsikor@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/asp/quickref/server_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