views:

465

answers:

2

We are troubleshooting a SQL Server 2005 connection issue on a closed-source third-party ASP.NET application. The application is a .NET application and the developing company is using a custom formatted configuration file that stores the SQL Server authentication information.

The application when trying to connect to our SQL Server box is getting a "Cannot open database 'databasename'. Login failed for user 'username'" error. We have tested connecting to the SQL Server box from the web server using SQL Server Management Studio and the login information provided to their app, it works perfectly.

Is there any easy way that we can sniff/determine the SQL Server Connection information they are trying to use inside their SqlCommand? Debugging their code is not an option, as it is compiled in Release Mode, and we don't have source. We simply need something to be able to identify why their app cannot connect.

A: 

I just asked some of the guys here and they both recommended trying reflector. If you had some hard coded values in the library, you should be able to see something there.

Chris Missal
We tried that, it doesn't appear to be hard coded. The application stores config in xml files, as well as the registry, all encrypted. We really almost need to intercept the passed connection string that goes from the app to the SQL Server box...
Mitchel Sellers
+1  A: 

run profiler and choose Security Audit: Audit Login, Audit Login Failed and Audit Logout events. choose all columns. from that you'll get the app name, and the user that tries to log in from the login failed event. once you get that check which database is default for that user in SQL Server users.

Mladen Prajdic
We have done all of that, and the account is valid....we need to know what password and other information is being passed.
Mitchel Sellers
if the username is valid that means that you don't need it's password, since it can log into the server ok. the problem lies in the default database for that user.at least that's my understaning of your problem
Mladen Prajdic