Re: Trying to get a VB.net sample working with SQL Server.

From: Greg Burns (greg_burns_at_DONT_SPAM_ME_hotmail.com)
Date: 12/20/04


Date: Mon, 20 Dec 2004 13:40:04 -0500

A quick search on google and I see Trusted_Connection=yes is pretty commonly
used. One of my ADO.NET books talks about all the these different valid
variations. I'll have to look it up later tonight.

Greg

"John Blair" <john_blair@hotmail.com> wrote in message
news:ZtExd.1173$sQ5.558@newsfe6-gui.ntli.net...
> Greg,
>
> Thanks very much for taking time to reply....SQL Server logon approach is
> much clearer thanks!
>
> FYI " Trusted_Connection=yes" was taken directly from the online sample
> (url below) and works on my win XP PC:
>
> http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=%2fquickstart%2faspplus%2fsamples%2fcache%2fdatacache1.src
>
> "Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
> news:OQS3RHr5EHA.1404@TK2MSFTNGP11.phx.gbl...
>> SQL server can have two types of logins. SQL accounts and Windows
>> accounts. You can setup SQL to run in mixed mode (SQL and Windows) or
>> Windows only. (I think MSDE is Windows only by default??)
>>
>> ASPNET is a windows account.. One correct method of setting up of SQL
>> (if you have the GUI tools, which MSDE does not come with), is to add the
>> windows ASPNET user to the server (this allows it to connect to the
>> server, but with no access to any databases). Next step is to map that
>> windows account to a SQL login and give it approriate permissions to a
>> database.
>>
>> As far as your question...
>>
>> When a ASP.NET page executes, it uses the ASPNET windows identity. (You
>> can change this in web.config with <identity impersonate="true"/>, but I
>> wouldn't unless you have a good reason to.). In your connection string
>> you told it "Trusted_Connection=yes" (Note: I've normally seen
>> "Trusted_Coonection=True", or "Integrated Security=SSPI", which both are
>> equivalent. I've NEVER seen Trusted_Connection=yes", but maybe that
>> works too!?!) That says to connect to the database using the identity of
>> the current user (which going to be the ASPNET user, since this is a web
>> app). No need to specify a password, because it is going to use windows
>> authentication, not SQL authentication.
>>
>> Make any sense? I am beginning to ramble.
>>
>> Greg
>>
>>
>> "John Blair" <john_blair@hotmail.com> wrote in message
>> news:oMCxd.1101$sQ5.52@newsfe6-gui.ntli.net...
>>> Very impressed Greg thanks - that worked a treat!
>>>
>>> I had the ASPNET user on my system in the "users" group but not in the
>>> administrators group.
>>>
>>> Could you clarify one thing for me....i normally work with oracle
>>> ...this is the first time with SQL Server ....i was thinking
>>> the database connection trying to use the ASPNET user was a DATABASE
>>> user and not a windows XP user account.....which database user account
>>> is used for the SQL Server connection and how does VB.net know the
>>> correct password?
>>>
>>> Thanks a lot!
>>>
>>> "Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
>>> news:uIZgZdq5EHA.3124@TK2MSFTNGP11.phx.gbl...
>>>>
>>>> "John Blair" <john_blair@hotmail.com> wrote in message
>>>> news:yGBxd.84$206.64@newsfe5-gui.ntli.net...
>>>>> So my question is: How do i configure the pubs database with the
>>>>> correct
>>>>> user accounts and passwords for the samples to work?
>>>>
>>>> It is pretty easy if you have SQL Enterprise Manager. If not, then not
>>>> so much. :^)
>>>>
>>>> Quick & dirty way: If this is purely for testing on your home box, then
>>>> just add the ASPNET user to the local adminsitrator group in Users &
>>>> Computers. That will make that user admin for all the databases on your
>>>> MSDE.
>>>>
>>>> If your have SQL EM that are more appropriate ways of setting this up
>>>> correctly. You can even do it using a command prompt and OSQL if you
>>>> are feeling so inclined.
>>>>
>>>> HTH,
>>>> Greg
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Relevant Pages

  • Re: Access the filesystem with SQL server 2005
    ... statement as a SQLuser and it works. ... my windows account and is stops working. ... Program Manager - SQL Server ...
    (microsoft.public.sqlserver.security)
  • [TOOL] Resources for Combating the Slammer Worm
    ... installations of Microsoft® SQL Server™ and the Microsoft SQL Server ... SQL Server 2000 SQL Scan Tool ... runs on computers running Windows 2000 or higher and can identify ... Check runs on computers running Windows 98, Windows ME, Windows NT 4.0, ...
    (Securiteam)
  • Re: connection options to yukon
    ... If you use TLS you can increase the security of your SQL auth ... connection but unless you're good at setting up groups/schema/logins/users, ... Windows auth is slower as the domain must ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connect problem MSDE ADO ASP
    ... problems on setting the IIS User password. ... result - and both can access the MSDE SQL via the webinterface (I am aware I ... > your connection string, and put in a valid SQL USER ACCOUNT, not a Windows ...
    (microsoft.public.sqlserver.programming)
  • Re: ANNOUNCEMENT: New SQL Server security tool - SQL Server 2000 Scan Tool
    ... windows user that they aren't running this code? ... > SQL Scan will scan a computer, a domain or a range of IP addresses. ... > Jerry Bryant - MCSE, ... > rights. ...
    (microsoft.public.security)