Re: problem connecting to SQL Server by Greg
Greg
Mon Nov 24 17:10:10 CST 2003
Miha,
I did finally get it working, but I'm confused about it.
Previously, I had added "Network Library=DBMSSOCN" to the
connection string. At some point after that, I added the
identity tag in web.config to ensure that it was running
under the desired account. After removing the Network
Library setting, then it started working. I don't
understand this because I thought DBMSSOCN was the
default, so it shouldn't have made a difference, and
either way I think it should have worked that way.
Also, since in the identity element I specified the same
account that was specfied in the IIS Console, this seems
to imply that the IIS setting was having no effect. Does
that sound right?
Any insight would be appreciated, although at this point
I'm just happy that it's working.
Thanks,
Greg
>-----Original Message-----
>Hi Greg,
>
>Does your account have network privileges?
>What happens if you switch to sql server authentiacation?
>
>--
>Miha Markic - RightHand .NET consulting & software
development
>miha at rthand com
>
>"Greg Bahns" <greg@no.unwanted.mail.bahns.com> wrote in
message
>news:e%233Pp1fsDHA.1884@TK2MSFTNGP10.phx.gbl...
>> Thanks for your reply.
>>
>> I forgot to mention that I am running both the ASP and
the ASP.NET
>> applications under the same account.
>>
>> I began to wonder if setting the account under the
Directory Security tab
>in
>> the IIS console applies to ASP.NET, and it this point
I'm not sure.
>>
>> Now I have specified the account using the identity
tag in web.config.
>I'm
>> now pretty certain that it's running under the desired
account, because
>when
>> I change the password, the ASP.NET application returns
the appropriate
>> error.
>>
>> Unfortunately, when I set it all up and try again, I
still get the "SQL
>> Server does not exist or access denied" error.
>>
>> One more note: this error is returned after 15
seconds, which is the
>default
>> connection timeout. This fact seems consistent
with "server not found" as
>> opposed to "access denied".
>>
>> Thanks,
>> Greg
>>
>>
>> "Miha Markic" <miha at rthand com> wrote in message
>> news:ey8t4nesDHA.3416@tk2msftngp13.phx.gbl...
>> > Hi Greg,
>> >
>> > Since ASP.NET application runs under very restricted
aspnet windows
>> account
>> > it has no privileges to access network plus the
account is local to your
>> > computer.
>> >
>> > The solutions would be:
>> > - use Sql server authenticaton
>> > - run your application under different account
>> >
>> > --
>> > Miha Markic - RightHand .NET consulting & development
>> > miha at rthand com
>> >
>> > "Greg Bahns" <greg@no.unwanted.mail.bahns.com> wrote
in message
>> > news:e4NWehesDHA.1740@TK2MSFTNGP12.phx.gbl...
>> > > I am having a strange problem connecting to a SQL
Server 2000 database
>> > from
>> > > an ASP.NET application.
>> > >
>> > > The strange thing is that I can connect fine using
ADODB in an
>> > old-fashioned
>> > > ASP application, but I get the message "SQL Server
does not exist or
>> > access
>> > > denied" when I try to connect using the
SqlConnection object in an
>> > ASP.NET
>> > > C# application running on the same machine.
>> > >
>> > > The database is SQL Server 2000 running on Windows
Server 2003, and
>the
>> > > development machine is running Windows XP with
VS.NET 2003, .NET
>> Framework
>> > > 1.1.
>> > >
>> > > The database server is named "mydbserver", and the
developer machine
>is
>> > > named "mywebserver".
>> > >
>> > > Here is the connection string from the old ASP
application:
>> > > Provider=SQLOLEDB;Server=mydbserver;Initial
>> > > Catalog=Contacts;Trusted_Connection=Yes
>> > >
>> > > Here is the connection string from the new ASP.NET
application:
>> > > workstation id=mywebserver;packet
size=4096;integrated
>> security=SSPI;data
>> > > source=mydbserver;persist security
info=False;initial
>catalog=Contacts;
>> > >
>> > > I should also point out that I have no trouble
connecting from the
>> VS.NET
>> > > environment itself, under the Data Connections
subtree in the Server
>> > > Explorer pane. The ASP.NET connection string
above was generated
>> > > automatically for me when I added a SqlConnection
object in the
>> designer,
>> > so
>> > > you would think it would work.
>> > >
>> > > From this I would guess that there's some
configuration that's wrong,
>> but
>> > > I've tried a number of things and numerous MSDN
and google searches
>with
>> > no
>> > > luck. I'm hoping someone here can help.
>> > >
>> > > Thanks,
>> > > Greg
>> > >
>> > >
>> > >
>> >
>> >
>>
>>
>
>
>.
>