views:

156

answers:

2

I am migrating a classic ASP web app to new servers. The database back end is migrating from SQL Server 2000 to SQL Server 2008, and the app is moving from Win2000 x86 to Win2003R2 x64. I am getting the above error on every single stored procedure call within the application.

I have verified:

  • Yes, the SQL user is set up, using correct username and password
  • Yes, the SQL user has execute permissions on the stored procedures in the database
  • Yes, I have updated the TypeLib references to the new UUID
  • Yes, I have logged into the database via SSMS with the SQL user id and it can see and execute the stored procedures just fine in SSMS, but not from the web app.
  • Yes, the SQL user has the database set as its default database.

The most frustrating thing is it works fine on the DEV server, but not on the production server. I have gone through every IIS setting 5 or 6 times and the web app is set up precisely the same in both environments. The only difference is the database server name in the connection string (DEV vs prod)

EDIT: I have also tried pointing the prod web box at the dev database server and get the same error so I'm fairly sure the issue isn't on the database side.

A: 

Are you sure that you are really connected to the instance and database you think you are (in the App)? It only takes the wrong DB in the connection string to override the default database for the user.

Can you execute some inline SQL on the connection like:

SELECT @@SERVERNAME AS SERVERNAME
    ,DB_NAME() AS [DB_NAME]
    ,CURRENT_USER AS [CURRENT_USER]
Cade Roux
Yes, I'm an idiot. The app connects to two different databases on the SQL box and I, in a fit of copy/paste stupidity, had given both connection strings in the global.asa file to the same name, so it was using the second connection string for every connection. Couldn't find the stored procs because it was looking in the wrong database. Thanks....
BBlake
@BBlake We're all idiots - that's why we're here.
Cade Roux
A: 

It might be the schema. Have you set the default schema of your user in the database you are using?

Iraklis