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

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Connection String for Local SQL Server & classic A

Author  Topic 

Starting Member

3 Posts

Posted - 2010-10-24 : 14:53:06
I have a standard install of SQL Server 2008 and I have a classic ASP website on my local box (windows 7) hosted on IIS.

I can not get the ASP to connect to the database at all, after hours of trying and Googling, can you help?

My Connection string is:

Set DBConnection = Server.CreateObject("adodb.connection")
dsn="Driver={SQL Server}; Server=(local); Database=dbwork; UID=workuser; PWD=workpassword;"
DBConnection.Open DSN

All I get is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'workuser'.

I have tried to login via this login on SQL management studio instead of my Windows auth and it also throws me an error. (Login failed 18456)

The user is set up in Security/Logins and mapped to the db. One thing I did note is if I put any server name in I get the same error


Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-10-24 : 14:57:16

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

Starting Member

3 Posts

Posted - 2010-10-24 : 15:08:52
Yeah I've tried a few of them and also renaming the server name to my PC name and still errors.

My latest is:


and I get

Microsoft SQL Server Native Client 10.0 error '80040e4d'

Login failed for user 'workuser'.

is something setup wrong is SQL as I can't use thee details to log in via management studio?
Go to Top of Page

Starting Member

3 Posts

Posted - 2010-10-24 : 15:19:44
Must have been the way the user was set up, just allowed full access to anyone and it works.

It will do
Go to Top of Page


5072 Posts

Posted - 2010-10-25 : 13:08:26
Don't allow "full access" to anyone. Fix the specific user permissions you need.
Go to Top of Page

- Advertisement -