How To Increase The Timeout Limit on ODBC Long Queries - Currently Times Out at 40 minutes

Richard Locus 26 Reputation points
2022-12-21T21:30:10.61+00:00

Hello:
I am using an ODBC link from Microsoft Access to my client whose system is based on Azure. When I do a long query that lasts over 40 minutes, I get a message that the connection was terminated by SQL Server.
How Can I increase the time limit for a long ODBC connection to more than 40 minutes?
Thanks,
Rich Locus

Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 34,556 Reputation points MVP
    2022-12-22T02:02:30.127+00:00

    Try setting the timeout to zero as follows:

    lblMessage.Text = sql         
    cmd = New OdbcCommand(sql, conn)    
      
    cmd.CommandTimeout= 0     
      
    ra = cmd.ExecuteNonQuery()        
    lblMessage.Text = "ssssst"   
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Richard Locus 26 Reputation points
    2022-12-22T18:41:50.64+00:00

    Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.