Link to home
Start Free TrialLog in
Avatar of jbotts
jbotts

asked on

Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server Connection

I am using Windows XP Professional and have installed MSDE 2000. I have searched the information on the Experts Exchange site and cannot find a solution as it applies to Windows XP. The connection object is set as follows:

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
                     "User ID=sa; Initial Catalog=Movie;" & _
                     "Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"

In prior discussions on Experts Exchange, there is mention of Windows security settings and security settings for the SQL Server. I don't know how to access those to make changes.
Avatar of QPR
QPR
Flag of New Zealand image

Hi jbotts,
have a read here
http://support.microsoft.com/kb/889615/en-us
Avatar of jbotts
jbotts

ASKER

Thanks QPR
I have read the suggested material and there is a suggestion to go into "Enterprise Manager" which is either not part of Windows XP Professional or I don't know how to access it. The only other solution is to make changes in the registry through the registry editor. I don't know the command line for to run the registry editor.
Thanks,
jbotts
Ahhh do you have a SQL Server disc?
What you need is "client tools for SQL server" installed on your workstation.
This will allow you to admin the MSDE installation.... create users, make tables etc.

Some development programs have the ability to connect to SQL/MSDE and show you the contents.
WebMatrix is an (free from www.asp.net) program that springs to mind.
Are you trying with MSSQL 7 ot MSSQL 2000?? as your File path suggests MSSQL 7??
should include pwd parameter in your connection string.

objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
                     "User ID=sa; Pwd= sapassword Initial Catalog=Movie;" & _
                     "Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"
SOLUTION
Avatar of wraith821
wraith821

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jbotts

ASKER

I have done the following:

1. Changed the registry to enable Mixed Authentication
       HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer - LoginMode = 2
2. Code for the connection has changed to:
       objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
                            "User ID=sa; Pwd= sapassword Initial Catalog=Movie;" & _
                            "Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"

The connection still does not work. The message is:
       Login failed for user 'sa'.
and the password you are using in your conn string is definately the SA's password (case sensitive)?
Avatar of jbotts

ASKER

I am new at this. I just installed the MSSQL Server (MSDE 2000). I am not sure what the user name or passwords are. How may I find out?
SA username is always SA.
MS SQL propmts you for a SA password when you install SP3 or higher (if none exists).
I'm not sure about MSDE

Try not passing a password at all e.g. User ID=sa; Pwd=
Also, should there be a semi colon (;) betwen the logon credentials and the initial catalog?
Avatar of jbotts

ASKER

QPR,
I made the corrections in the code and got the same message.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
typical... i get a B and an assist because i told you exaclty what the link the accepted answer gave you? again the world makes since