Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 I cannot cconnect to my SQL Server database

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-03-18 : 06:19:40
Carlos writes "I am completely new to SQL Server. I thought I knew what I was doing but apparently I don't. I am familiar with ASP, SQL and ADO. I first created a user for a database using the wizard. Then when I use a connection tring i found on the internet, it displays an error saying "Not associated with a trusted SQL Server connection."

So, I need help in establish a user for the database and the correct connection string to connect to the database. Help?

Carlos Rodriguez
www.carlos.rodriguez.org"

vganesh76
Yak Posting Veteran

64 Posts

Posted - 2003-03-18 : 08:29:17


Probably u can try inserting this code in ur asp page


Please replace the ServerName with the actual Server u want to connect.
Please replace the databasename with the database which u want to refer residing in the Server(ServerName)


Dim conn
Set conn = server.createobject("ADODB.connection")

ConnectinString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=userid;PWD=password;Initial Catalog=databasename;Data Source=ServerName"

conn.open connectionstring


once u execute the statement ur connection is open



Enjoy working
Go to Top of Page

neil
Starting Member

29 Posts

Posted - 2003-03-19 : 07:54:38


You need to set-up SQL server to Windows and SQL Server authentication.

This way you can use SQL server users to access the Database.

You can use this through enterprise manager \ right click on the server name \ click on properties \ security tab \ select windows and sql server authentication

Neil



Go to Top of Page

JohnDeere
Posting Yak Master

191 Posts

Posted - 2003-03-19 : 07:58:59
I believe the userid and password passed in the connection string must belong to a valid sqlserver account. You can use nt_authentication, but it is limited to one server hop unless Kerberos security is enabled.

Lance Harra
Go to Top of Page
   

- Advertisement -