Results 1 to 4 of 4

Thread: Help with a weird connection error

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    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.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    doesn't anyone have any ideas..?
    Secret to long life:
    Keep breathing as long as possible.

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Location
    Omaha, Ne
    Posts
    65

    Exclamation What if...

    It's a shot in the dark but what if (or have you tried) to set ors to nothing?

    Just a thought.

  4. #4
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width