Sql in asp? Please help! (1 Viewer)

vidus

Confused User
Local time
Today, 15:03
Joined
Jun 21, 2009
Messages
117
Please help me! I have been trying this forever and I cant make it work. I am new at sql and everything. I just want to connect to my sql in asp. I have looked everywhere and even bought a book but It just will not work.

I have tried hundreds of combinations because there seems to be a million different methods of connection and I am so frustrated.

I have created my sql server with sqlexpress2008 and created a database. I created a system dns with mixed authentication.

I am trying this code and it makes so sense to me why it will not work. The dsn tests the connection and it succeeds. Is there anyone who can help me?

Code:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSN=TestSQL;UID=TEST-PC\TEST;PWD=*****;DATABASE=TestSQL"
%>

All the info there is correct, it must be. But why do I need a password if this is a trusted connection. I cant find any examples of a dsn sql connection with a trusted connection...

I get this error all the time:
Code:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "MarconSQL" requested by the login. The login failed.

/test.asp, line 16

So confused and frustrated please help if you can :(
 

ByteMyzer

AWF VIP
Local time
Today, 15:03
Joined
May 3, 2004
Messages
1,409
Try changing:
Code:
Conn.open "DSN=TestSQL;UID=TEST-PC\TEST;PWD=*****;DATABASE=TestSQL"
...to:
Code:
Conn.open "DSN=TestSQL;DATABASE=TestSQL;Trusted_Connection=True;"
 

Users who are viewing this thread

Top Bottom