-
I wrote some code which goes into a bunch of tables to extract and assimilate some data. I'm doing a DSN-less connection to a database and I create one connection object at the top of the page. I then use this connection many times throughout the page to generate resultsets and execute commands. To me, this seems like pretty good style, and seemed to be working fine -- for a while.
Recently, I've been getting this wacko error:
Code:
Error:
Microsoft OLEDB Provider for ODBC Drivers error 80004005
{Microsoft}{ODBC}{SQL Server}{Named Pipes}Invalid Connection
line 221
or sometimes the 'Invalid Connection' is 'Connection broken'
This is a very weird error, considering it will pump out a bunch of data, and then fail somewhere near the end, or the middle (randomly). For some reason, the connection that it has been using, suddenly becomes invalid?! what's that about?
Here is the ASP I'm using:
Code:
'connection string
myString = "Driver={SQL Server};Server=serverName;UID=userName;PWD=passWord;Trusted_Connection=no"
'create connection
set oConn=Server.CreateObject("ADODB.connection")
oConn.open myString
'use connection a bunch of times and it works fine!
'suddenly, it fail at a random statement that uses it, such as
stmSQL = "SELECT* from TableName where something = 'somethingElse'"
set oRS = Server.CreateObject("ADODB.recordset")
oRS.open = oConn.Execute(stmSQL)
Can a connection expire after you call it too many times or something>?>?
Anybody have any suggestions?
Thanks a bunch
dvst8
-
doesn't anyone have any ideas..?
-
What if...
It's a shot in the dark but what if (or have you tried) to set ors to nothing?
Just a thought.
-
ohboy!
I am experiencing another problem... with ADO
but your question... raised a good point
What is the CommandTimeOut property of the recordset
and or the command object in ADO for...It seems like the
default is 15??
If I make no sense, please ignore