Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error 3709 The connection cannot be used to perform this operation. It is either closed or invalid...


Error 3709 The connection cannot be used to perform this operation. It is either closed or invalid in this contex

Author
Message
jack-64275
jack-64275
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 559

I'm just the DBA so I'll try to explain this with out making a fool of myself...

We have an application that currently runs in production and has a NT/SQL 7.0 backend. We'll call it "server". We are trying to migrate to a Windows2K/SQL2K server currently named "newserver". We have no issues in the current prod. environment or testing in the new environment. Our goal is to move the database and rename, take "server" offline and rename "newserver" to "server".

The production application is able to initially connect but receives:

Error 3709 The connection cannot be used to perform this operation. It is either closed or invalid in this context.

when the users go to use any of the functions of the app.

Thanks





Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14959 Visits: 38980

I typically see this when an ADODB connection has not been opened, and then you try to open a recordset with the still closed connection;

for example:

dim conn As New ADODB.Connection

conn .ConnectionString = Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Password=unknown;Initial Catalog=pubs;Network Library=dbmssocn; Data Source=someserver;

conn .CursorLocation = adUseClient

'--commented out to duplicate error!

'conn.Open

dim rs as new adodb.recordset

rs.Open "SELECT * FROM AUTHORS", conn, adOpenStatic, adLockReadOnly

--THIS WILL RAISE THE ERROR BECAUSE THE CONNECTION IS NOT OPEN

In an app I had, the connection was opened in a separate procedure with on error resume next, and then a different procedure, which assumed the conn was .Open would raise the same error, because the previous connection failed error was supressed.

hope that helps



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

jack-64275
jack-64275
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 559

Thanks Lowell. I've forwarded this on to the developers. Here's a little more detail:

The production code works without issue using the production web server and SQL 7.0

We also moved the production code to the dev. web server and ran it against the new sql2k server with out a problem.

We are only seeing the error when running the prod. code on the prod. web server against the sql2k server after we did the rename of that sql server (took sql 7.0 server off line and rename the sql2k server to the 7.0 name... no code changes.)

Once we renamed the sql server we were able to run the app. from the dev. web server with out any problem.

It all seems to be pointing to an issue with the prod. web server...





Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14959 Visits: 38980

i would bet that a connection string is incorrect when it is moved to production...

I don't know your app of course, but if the connections string is hardcoded to look for a specific machine name, ip address, database name, then it might fail;

check the basics of the connection string:

from the production machines perspective,

does the server exist?

database name exist?

user exist?

user have permissions to the database in question?

user can log into the db From query analyzer with the password supplied?



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

jack-64275
jack-64275
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 559

For what ever reason the prod. IIS server is using multiprotical... I went to server network utility and everything is gravy.

Thanks for the suggestions... my programming career is officially over!





Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search