Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC connection datasource dsn HELP PLEASE

Status
Not open for further replies.

jennypretty

IS-IT--Management
Apr 13, 2005
45
US
Hello friends,
I created an odbc datasourcse 'JennyDSN' to connect to sql server db and it was sucessful. When I open an asp file, it showed this error:
odbc sql server driver login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

This line: dbConn.open generate error.

I stored a datasource in global.asa file and here it is:
<!--==Visual InterDev Generated - startspan==-->
<!--METADATA TYPE="TypeLib" NAME="Microsoft Excel 10.0 Object Library" UUID="{00020813-0000-0000-C000-000000000046}" VERSION="1.4"-->
<!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.5 Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" VERSION="2.5"-->
<!--METADATA TYPE="TypeLib" NAME="Microsoft Scripting Runtime" UUID="{420B2830-E718-11CF-893D-00A0C9054228}" VERSION="1.0"-->
<!--METADATA TYPE="TypeLib" NAME="Microsoft Office XP Web Components" UUID="{0002E550-0000-0000-C000-000000000046}" VERSION="1.0"-->
<!--==Visual InterDev Generated - endspan==-->

<OBJECT RUNAT=server SCOPE=Session PROGID=ADODB.Connection id=dbConn></OBJECT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>


Sub Session_OnStart()
dbConn.ConnectionString = "DSN=JennyDSN;"
End Sub

Sub Session_OnEnd()
dbConn.Close()
End Sub
</SCRIPT>
 
If you look at the end, you 'll see my connection string.
If I use "With Windows NT authentication ...", then it worked fine.
If I use "With SQL Server authentication ...", then it generate that error.

Sub Session_OnStart()
dbConn.ConnectionString = "DSN=JennyDSN;"
End Sub

Sub Session_OnEnd()
dbConn.Close()
End Sub
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top