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

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Another 'Login Fail' issue (didn't want to hijack)

Author  Topic 

Nexzus
Starting Member

14 Posts

Posted - 2011-02-28 : 18:46:23
Hi,

Background: using a custom-written c# 2.0 console application to pull data out of a restored database on a Windows SQL Server 2005 64 bit. This was basically a fresh install of SQL Server with mixed mode Authentication, and the database was restored using a backup file from the production system.

I created a new Database, went Task->Restore->From file, and it went smoothly. I can view the tables in Management Studio. Repeat 6 times with 6 different databases, and all went well. If you're curious, they are site-specific Filenet EMDS databases that I am migrating into 1 central document management system.

For various reasons, I run my console program as a different user than my logon. Everything has been working great, and I can connect to five of the six databases from my console program. For one particular database though, I am getting the error:

Cannot open database <databasename> requested by the login. The login failed. Login failed for user 'DOMAIN\useraccount'

My useraccount has full permission to all databases on the server. In fact, if I run Management Studio as useraccount, I can connect to the problem database just fine.

Here's my application connection string (SQLConnection class), and I'm thinking it probably has something to do with it, but I'm loathe to change as it works 86% of the time. Plus there's nothing really fancy about it.

data source=" + server + ";initial catalog=" + database + ";integrated security=SSPI;persist security info=False;Trusted_Connection=Yes";

I've compared all the options for the databases, and they're all pretty much the same. Deleting the database and restoring it produces the same results.

I'm stumped right now.

Thank you for your help.

Nexzus
Starting Member

14 Posts

Posted - 2011-03-01 : 11:58:44
Turns out I'm an idiot, and I had an oh instead of a zero for the database name in the connection parameters.
Go to Top of Page
   

- Advertisement -