ODBC Timout. Error 3146

  • I have an Access 2003 databse with tables linked to an SQL back end.

    I have a piece of code that creates and attempts to open a recordset on one of these linked tables. 

    However I get ODBC call failed error 3146 or such like.

    Looping through the errors collection it seems the request has timed out.

    Any ideas.?

  • Would you mind posting the code that creates the recordset?

  • You can try increasing ODBC timout for Access query. I think default is 60 secounds by Access.

  • hello there,

    I had to deal with something similar when migrating some ms access apps to sql server...

    I've just changed the ODBC timeout property in the query designer to 0secs. You can do this programatically also through ADO

    Hope it helps,

    Nuno Paiva

  • Cheers guys

    but the problem is when accessing a linked table via code.

     

    i.e. linked table = 'subscriptions'

    code =

    dim mydb as database

    set mydb = currentdb()

    dim myrs as recordset

    set myrs = mydb.openrecordset("subscriptions")

     

    This times out with an ODBC 3146 error.  I have also tried accessing the table directly on the server via ADO, but that times out also unless I set the timeout = 0 (which I don't like doing except for testing) in which case it just hangs.

    Incidentaly, this code is found in the middle of quite a large module that opens many recordsets.  If I create a stand alone module and try to access the table via ADO (only tried that so far) it works fine.

    I'm thinking there is a problem somewhere with the number of connections to the database.?

     

  • While the code is hanging you might want to check out the locks on the subscription table to see if something else is blocking it.

  • I ran into this error just today, also from an MS Access linked table to SQL Server.  Running DBCC INDEXDEFRAG on the SQL Server table fixed the issue.


    Joseph

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply