Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Problem in establishing a connection with SQL Server 7.0


Message #1 by "Khalid Qureshi" <khalidone@y...> on Wed, 8 Jan 2003 09:26:15
I have imported an Access database to MS SQL Server 7.0
Now I want to connect this database using ASP code. I have written 
following code But I receive an error message

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for 
user 'PENTIUM\IUSR_PENTIUM'.

I have made a System DSN with the name Orient and tested it which and 
found working.

I have written a following piece of code in Asp for database connection

	Dim objConn
        Set objConn = Server.CreateObject ("ADODB.Connection")
	Objconn.open "dsn=Orient" 

The same code work with Access database but not working with SQL Server.

I have also tried it with a connection string but that is also not working.

Please help me out. That will be a great help for me.
Message #2 by "Nataraj" <nattyboy@j...> on Wed, 8 Jan 2003 14:58:07 +0530
Hi,

    did u test the connection while creating the DSN ? .. also try using the
Sql Server Authentication providing 'sa' or ur other user id and password
instead of the NT Authentication ..

also while opening the connection u have to provide the User Name and
Password even if u have given it in the DSN itself ! .. try it ..

- Nataraj

----- Original Message -----
From: "Khalid Qureshi" <khalidone@y...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, January 08, 2003 9:26 AM
Subject: [asp_databases] Problem in establishing a connection with SQL
Server 7.0


> I have imported an Access database to MS SQL Server 7.0
> Now I want to connect this database using ASP code. I have written
> following code But I receive an error message
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
> user 'PENTIUM\IUSR_PENTIUM'.
>
> I have made a System DSN with the name Orient and tested it which and
> found working.
>
> I have written a following piece of code in Asp for database connection
>
> Dim objConn
>         Set objConn = Server.CreateObject ("ADODB.Connection")
> Objconn.open "dsn=Orient"
>
> The same code work with Access database but not working with SQL Server.
>
> I have also tried it with a connection string but that is also not
working.
>
> Please help me out. That will be a great help for me.


  Return to Index