|
-
Aug 17th, 2000, 12:28 PM
#1
Thread Starter
Addicted Member
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
Secret to long life:
Keep breathing as long as possible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|