When using a ODBC driver, you normally have 2 types of ODBC timeouts : a Connect Timeout and a General Timeout. The Connect Timeout is the time the driver waits to validate the connection wanted. If passed, your connection fails. The other one is the time delay the driver uses to check if the communication between the client and the server is still valid. If for example your network connection falls down, the general timeout will notice that and produce the error mentioned. It also can come from a less performant SQL Server server or network, so the answers to your query takes too long or the network is too slow. You can test this by running the query directly on the database server to see how long it takes to produce the query as such. If this goes fast, you can check your network by running the same query from an isql session from a client PC. If this is slow, you know it’s the network. If not, you know it has to do with your ODBC settings or the ADO data connection type you use. If you set the timeout to 0 – meaning that no timeout is specified – you’re VB program must work. If not, something else is wrong with your code. If ok, you can play with the timeout settings, 60 (1′) – 300 (5′) etc. to find the ideal setting for your apps. You can also optimise your connection method in VB for first record retrieval or not (fetch first 10 records, then the rest).
I hope this will help you in resolving your problem.