ASP and DB - different servers

ASP and DB - different servers

am 03.06.2005 20:41:31 von r

I have a database on one server (server1), and a web site on another
(server2). How would I reference the DB from server1 from the ASP pages on
server2?

And can I?
Robyn

Re: ASP and DB - different servers

am 03.06.2005 20:56:15 von unknown

What kind of database?

Ray at work

"R" wrote in message
news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
> I have a database on one server (server1), and a web site on another
> (server2). How would I reference the DB from server1 from the ASP pages
on
> server2?
>
> And can I?
> Robyn
>
>

Re: ASP and DB - different servers

am 03.06.2005 20:59:12 von r

Thanks Ray
it's either an Access 2000 or 2002


"Ray Costanzo [MVP]" wrote in
message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
> What kind of database?
>
> Ray at work
>
> "R" wrote in message
> news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
>> I have a database on one server (server1), and a web site on another
>> (server2). How would I reference the DB from server1 from the ASP pages
> on
>> server2?
>>
>> And can I?
>> Robyn
>>
>>
>
>

Re: ASP and DB - different servers

am 03.06.2005 21:19:46 von unknown

In that case, you just use the UNC path to the database.
\\servername\sharename\file.mdb BUT, in a default setup, your IUSR account
on your IIS server will not be able to access that share. Even if the share
and NTFS permissions all everyone full access, IUSR won't be granted access.
Take a look here: http://www.aspfaq.com/show.asp?id=2168 (The "if the file
is within your LAN" section)

Ray at work

"R" wrote in message
news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
> Thanks Ray
> it's either an Access 2000 or 2002
>
>
> "Ray Costanzo [MVP]" wrote in
> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
> > What kind of database?
> >
> > Ray at work
> >
> > "R" wrote in message
> > news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
> >> I have a database on one server (server1), and a web site on another
> >> (server2). How would I reference the DB from server1 from the ASP
pages
> > on
> >> server2?
> >>
> >> And can I?
> >> Robyn
> >>
> >>
> >
> >
>
>

Re: ASP and DB - different servers

am 03.06.2005 21:54:08 von mmcginty

"R" wrote in message
news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
>I have a database on one server (server1), and a web site on another
>(server2). How would I reference the DB from server1 from the ASP pages on
>server2?
>
> And can I?

Yes you can, but there are environmental requirements... (as if that were
ever not the case.)

Usually the best option is to use "trusted" connections, where NT/Win2K/2K3
security accounts are used to authenticate access to SQL. If both servers
belong to the same domain it's pretty simple, you just use a domain account
for the anonymous user in IIS, and then grant appropriate SQL access to that
same domain user, by creating a SQL account for it, and defining it's
privileges. Be sure to disable the option that allows IIS to change the
password for this user.

If they are not members of a domain, it's still possible to use a trusted
connection, but it becomes a little dicey, you must create identical
accounts (same login, same password) on each box for the anonymous user. In
this case the machine portion of the credential is stripped and whichever
machine is being connected to, is assumed to be the login authority. This
will work, as long as the accounts are kept in sync.

If you can't get a trusted connection to work, you'll have to use SQL Server
security, which means the login and password for the accound will have to be
hard-coded into your connection string. (Less than ideal from a security
standpoint.)

The connection string for a trusted connection looks like this:

Provider=SQLOLEDB;Server=MYSERVER;Database=MYDB;Trusted_Conn ection=Yes;

And using SQL security:

Provider=SQLOLEDB;Server=MYSERVER;Database=MYDB;UID=sqllogin ;PWD=password;

Hope that gives you a jumping-in point.

-Mark



> Robyn
>

Re: ASP and DB - different servers

am 03.06.2005 22:03:34 von reb01501

Mark J. McGinty wrote:
> Usually the best option is to use "trusted" connections, where
> NT/Win2K/2K3 security accounts are used to authenticate access to
> SQL.


This is why i NEVER reply without first ascertaining the database being used
:-)
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: ASP and DB - different servers

am 03.06.2005 23:25:21 von mmcginty

"Bob Barrows [MVP]" wrote in message
news:uYqHRdHaFHA.1148@tk2msftngp13.phx.gbl...
> Mark J. McGinty wrote:
>> Usually the best option is to use "trusted" connections, where
>> NT/Win2K/2K3 security accounts are used to authenticate access to
>> SQL.
>
>
> This is why i NEVER reply without first ascertaining the database being
> used :-)

My bad :-)



> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>

Re: ASP and DB - different servers

am 03.06.2005 23:47:18 von r

Thanks very much - this will be the first thing I try and hope to make work.

Robyn



"Ray Costanzo [MVP]" wrote in
message news:eYMJ3EHaFHA.3040@TK2MSFTNGP14.phx.gbl...
> In that case, you just use the UNC path to the database.
> \\servername\sharename\file.mdb BUT, in a default setup, your IUSR
> account
> on your IIS server will not be able to access that share. Even if the
> share
> and NTFS permissions all everyone full access, IUSR won't be granted
> access.
> Take a look here: http://www.aspfaq.com/show.asp?id=2168 (The "if the
> file
> is within your LAN" section)
>
> Ray at work
>
> "R" wrote in message
> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>> Thanks Ray
>> it's either an Access 2000 or 2002
>>
>>
>> "Ray Costanzo [MVP]" wrote in
>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>> > What kind of database?
>> >
>> > Ray at work
>> >
>> > "R" wrote in message
>> > news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
>> >> I have a database on one server (server1), and a web site on another
>> >> (server2). How would I reference the DB from server1 from the ASP
> pages
>> > on
>> >> server2?
>> >>
>> >> And can I?
>> >> Robyn
>> >>
>> >>
>> >
>> >
>>
>>
>
>

Re: ASP and DB - different servers

am 04.06.2005 00:44:14 von r

Ok - so the error I do get is:

Error Type:
Microsoft ADO/RDS (0x800A2011)
Internet Server Error: Object/module not found


<%
set conn = CreateObject("ADODB.Connection")
conn.open "Provider=MS Remote;" &_
"Remote Server=http://servername;" &_
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=path\mdb;"
%>




<%
strSQL="select FirstName from Directory"
Set objRS = conn.Execute(strSQL) <----------- error flags this line
%>

is this permissions??

TIA



"Ray Costanzo [MVP]" wrote in
message news:eYMJ3EHaFHA.3040@TK2MSFTNGP14.phx.gbl...
> In that case, you just use the UNC path to the database.
> \\servername\sharename\file.mdb BUT, in a default setup, your IUSR
> account
> on your IIS server will not be able to access that share. Even if the
> share
> and NTFS permissions all everyone full access, IUSR won't be granted
> access.
> Take a look here: http://www.aspfaq.com/show.asp?id=2168 (The "if the
> file
> is within your LAN" section)
>
> Ray at work
>
> "R" wrote in message
> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>> Thanks Ray
>> it's either an Access 2000 or 2002
>>
>>
>> "Ray Costanzo [MVP]" wrote in
>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>> > What kind of database?
>> >
>> > Ray at work
>> >
>> > "R" wrote in message
>> > news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
>> >> I have a database on one server (server1), and a web site on another
>> >> (server2). How would I reference the DB from server1 from the ASP
> pages
>> > on
>> >> server2?
>> >>
>> >> And can I?
>> >> Robyn
>> >>
>> >>
>> >
>> >
>>
>>
>
>

Re: ASP and DB - different servers

am 04.06.2005 16:50:35 von jeff.nospam

On Fri, 3 Jun 2005 15:44:14 -0700, "R" wrote:

>Ok - so the error I do get is:
>
>Error Type:
>Microsoft ADO/RDS (0x800A2011)
>Internet Server Error: Object/module not found

Does the anonymous user account (or the account you're authenticating
as if you use authentication) have permission to the share where the
DB is located? Remember the anonymous user account is local so you
normally would not have access.

Jeff



><%
> set conn = CreateObject("ADODB.Connection")
> conn.open "Provider=MS Remote;" &_
> "Remote Server=http://servername;" &_
> "Remote Provider=Microsoft.Jet.OLEDB.4.0;" &_
> "Data Source=path\mdb;"
>%>
>
>
>
>
><%
>strSQL="select FirstName from Directory"
>Set objRS = conn.Execute(strSQL) <----------- error flags this line
>%>
>
>is this permissions??
>
>TIA
>
>
>
>"Ray Costanzo [MVP]" wrote in
>message news:eYMJ3EHaFHA.3040@TK2MSFTNGP14.phx.gbl...
>> In that case, you just use the UNC path to the database.
>> \\servername\sharename\file.mdb BUT, in a default setup, your IUSR
>> account
>> on your IIS server will not be able to access that share. Even if the
>> share
>> and NTFS permissions all everyone full access, IUSR won't be granted
>> access.
>> Take a look here: http://www.aspfaq.com/show.asp?id=2168 (The "if the
>> file
>> is within your LAN" section)
>>
>> Ray at work
>>
>> "R" wrote in message
>> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>>> Thanks Ray
>>> it's either an Access 2000 or 2002
>>>
>>>
>>> "Ray Costanzo [MVP]" wrote in
>>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>>> > What kind of database?
>>> >
>>> > Ray at work
>>> >
>>> > "R" wrote in message
>>> > news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
>>> >> I have a database on one server (server1), and a web site on another
>>> >> (server2). How would I reference the DB from server1 from the ASP
>> pages
>>> > on
>>> >> server2?
>>> >>
>>> >> And can I?
>>> >> Robyn
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>

Re: ASP and DB - different servers

am 06.06.2005 20:13:03 von r

That's what I thought - I have to wait till the Web Guy comes back in
tomorrow - he has the day off today, and then I'll talk to him about it.
Robyn

"Jeff Cochran" wrote in message
news:42a1bf6e.922334593@msnews.microsoft.com...
> On Fri, 3 Jun 2005 15:44:14 -0700, "R" wrote:
>
>>Ok - so the error I do get is:
>>
>>Error Type:
>>Microsoft ADO/RDS (0x800A2011)
>>Internet Server Error: Object/module not found
>
> Does the anonymous user account (or the account you're authenticating
> as if you use authentication) have permission to the share where the
> DB is located? Remember the anonymous user account is local so you
> normally would not have access.
>
> Jeff
>
>
>
>><%
>> set conn = CreateObject("ADODB.Connection")
>> conn.open "Provider=MS Remote;" &_
>> "Remote Server=http://servername;" &_
>> "Remote Provider=Microsoft.Jet.OLEDB.4.0;" &_
>> "Data Source=path\mdb;"
>>%>
>>
>>
>>
>>
>><%
>>strSQL="select FirstName from Directory"
>>Set objRS = conn.Execute(strSQL) <----------- error flags this line
>>%>
>>
>>is this permissions??
>>
>>TIA
>>
>>
>>
>>"Ray Costanzo [MVP]" wrote in
>>message news:eYMJ3EHaFHA.3040@TK2MSFTNGP14.phx.gbl...
>>> In that case, you just use the UNC path to the database.
>>> \\servername\sharename\file.mdb BUT, in a default setup, your IUSR
>>> account
>>> on your IIS server will not be able to access that share. Even if the
>>> share
>>> and NTFS permissions all everyone full access, IUSR won't be granted
>>> access.
>>> Take a look here: http://www.aspfaq.com/show.asp?id=2168 (The "if the
>>> file
>>> is within your LAN" section)
>>>
>>> Ray at work
>>>
>>> "R" wrote in message
>>> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>>>> Thanks Ray
>>>> it's either an Access 2000 or 2002
>>>>
>>>>
>>>> "Ray Costanzo [MVP]" wrote in
>>>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>>>> > What kind of database?
>>>> >
>>>> > Ray at work
>>>> >
>>>> > "R" wrote in message
>>>> > news:%23kTadvGaFHA.2288@TK2MSFTNGP14.phx.gbl...
>>>> >> I have a database on one server (server1), and a web site on another
>>>> >> (server2). How would I reference the DB from server1 from the ASP
>>> pages
>>>> > on
>>>> >> server2?
>>>> >>
>>>> >> And can I?
>>>> >> Robyn
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>>
>>>>
>>>
>>>
>>
>