ASP and DB - different servers
am 03.06.2005 20:41:31 von rI 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
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
What kind of database?
Ray at work
"R"
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
>
>
Thanks Ray
it's either an Access 2000 or 2002
"Ray Costanzo [MVP]"
message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
> What kind of database?
>
> Ray at work
>
> "R"
> 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
>>
>>
>
>
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"
news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
> Thanks Ray
> it's either an Access 2000 or 2002
>
>
> "Ray Costanzo [MVP]"
> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
> > What kind of database?
> >
> > Ray at work
> >
> > "R"
> > 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
> >>
> >>
> >
> >
>
>
"R"
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
>
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"
"Bob Barrows [MVP]"
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"
>
Thanks very much - this will be the first thing I try and hope to make work.
Robyn
"Ray Costanzo [MVP]"
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"
> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>> Thanks Ray
>> it's either an Access 2000 or 2002
>>
>>
>> "Ray Costanzo [MVP]"
>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>> > What kind of database?
>> >
>> > Ray at work
>> >
>> > "R"
>> > 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
>> >>
>> >>
>> >
>> >
>>
>>
>
>
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;"
%>
On Fri, 3 Jun 2005 15:44:14 -0700, "R"
>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]"
>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"
>> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>>> Thanks Ray
>>> it's either an Access 2000 or 2002
>>>
>>>
>>> "Ray Costanzo [MVP]"
>>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>>> > What kind of database?
>>> >
>>> > Ray at work
>>> >
>>> > "R"
>>> > 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
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>
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"
news:42a1bf6e.922334593@msnews.microsoft.com...
> On Fri, 3 Jun 2005 15:44:14 -0700, "R"
>
>>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]"
>>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"
>>> news:%23bPrV5GaFHA.2788@TK2MSFTNGP12.phx.gbl...
>>>> Thanks Ray
>>>> it's either an Access 2000 or 2002
>>>>
>>>>
>>>> "Ray Costanzo [MVP]"
>>>> message news:%23U3ts3GaFHA.2768@tk2msftngp13.phx.gbl...
>>>> > What kind of database?
>>>> >
>>>> > Ray at work
>>>> >
>>>> > "R"
>>>> > 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
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>>
>>>>
>>>
>>>
>>
>