View Single Post
  #8 (permalink)  
Old June 12th, 2003, 08:59 PM
KenSchaefer KenSchaefer is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

If you use Windows Authentication you *cannot* connect as "sa". "sa" is an SQL Server login. Windows Authentication means that you login to the SQL Server using your Windows Account, not with an account stored in SQL Server. For your ASP pages to login to SQL Server, you need to work out what user context the ASP pages are running under, and give that Windows account permission to login to the database. Usually ASP pages run under the default anonymous internet user account (IUSR_<machinename>), so you'd need to give that account permission to login to the database.

For Windows Authentication (or "trusted authentication" as it is otherwise known), you *do not* specify a uid or pwd in the connection string, because the Windows account that the process is running under is used to login to the SQL Server. You just do:

strConnect = _
"Provider=SQLOLEDB;" & _
"Data Source=myComputerName;" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI"

Cheers
Ken

www.adOpenStatic.com