Thursday, February 9, 2012

ASP.NET 2.0 / ASP and SQL Server 2005

I'm having to do some maintenance on a legacy site done in "classic" ASP. I've taken the site onto our new internal win2k3 box as it doesn't need to be public any longer and put the DB on sql server 2005. All good so far.

I can't get the app to connect to the DB at all. If I use the exact same connection string that works in an asp.net 2.0 app on the same server, it doesn't work. I don't even have to do a query, merely opening the connection will break it.

I use...
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "Data Source=********;Initial Catalog=intranet_database;Integrated Security=True" '(that's the connection string that works just fine on the asp.net app)

I get..
Microsoft OLE DB Service Components error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/v1/testing/default.asp, line 13

Most of the stuff I can see relates to datatypes and so on, but given the above I can't see how that might be.

Any ideas? Please! ;-)

I solved this by creating a black UDL file on the desktop and it generated a very different connection string. When I try and grant the ISR_MACHINENAME user access to the database I keep getting this not very helpful error message.

|||

Can't you edit a post? What I meant to say was...

Yeskin Gallen:

I solved this by creating a blank UDL file on the desktop and it generated a very different connection string. When I try and grant the IUSR_MACHINENAME user access to the database I keep getting this not very helpful error message...

TITLE: Microsoft SQL Server Management Studio

----------

Cannot show requested dialog.

----------

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

----------

The server principal "BEL-INTRANET-01\IUSR_BEL-INTRANET-01" is not able to access the database "self-builder-v1" under the current security context. (Microsoft SQL Server, Error: 916)

For help, click:http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476

----------

BUTTONS:

OK

----------

No comments:

Post a Comment