ODBC database timeout

I have just seen that MSSQLServerDatabase is now deprecated so I am moving over to using ODBCDatabase.
I understand the connection timeout can be set in the connection string using the Connection Timeout parameter.
When I did a test query I got a DatabaseException:

[Microsoft][ODBC Driver 17 for SQL Server]Query timeout expired

The documentation states that the Timeout property is the connection timeout and therefore I assume not the query timeout:
ODBCDatabase — Xojo documentation

However, if I set the Timeout to say 60 seconds, the query works fine. Therefore, is the documentation wrong and the Timeout property is actually the query (command) timeout?

1 Like

Setting the ODBCDatabase.Timeout property will set both the connection SQL_ATTR_LOGIN_TIMEOUT and statement SQL_ATTR_QUERY_TIMEOUT attributes to the value you set:

Dim db as New ODBCDatabase
db.Timeout = 60

Jonathan

1 Like