CloseODBC



[ODBC]
ConnectionTimeout=x
'To enforce the fastest possible timeout, you can set ConnectionTimeout

'to one. In addition, you can add this code after you close the database

'to make sure the connection is terminated:

db.Close ' Close database, using
' ' database object variable (db).

Start = Timer
Do ' This loop pauses a second
' ' to allow a time-out

FreeLocks ' Tell Microsoft Access
' ' engine that program is idle.

DoEvents ' Tell Windows to do any
' ' pending events.

Loop While Timer <= Start + 1
'This loop delays for a second after the db.Close. The FreeL

' ocks statement tells the database engine that the user is id

' le. If you run the Visual Basic program with ConnectionTimeo

' ut set to one in your VB.INI or .INI file,

' the database engine will disconnect the one-second-old conne

' ction to the server.


(closeodbc.html)- by Paolo Puglisi - Modifica del 25/3/2019