This example sets the LoginTimeout property of the DBEngine object to 120 seconds. It then opens three ODBCDirect workspaces and modifies their LoginTimeout properties from the default inherited from the DBEngine object.
Sub LoginTimeoutX()
' Change the default LoginTimeout value.
DBEngine.LoginTimeout = 120
Dim wrkODBC1 As Workspace
Dim wrkODBC2 As Workspace
Dim wrkODBC3 As Workspace
Set wrkODBC1 = CreateWorkspace("", "admin", "", _
dbUseODBC)
Set wrkODBC2 = CreateWorkspace("", "admin", "", _
dbUseODBC)
Set wrkODBC3 = CreateWorkspace("", "admin", "", _
dbUseODBC)
' Change the LoginTimeout of the individual ODBCDirect
' workspaces for 60 seconds, the default time (120
' seconds), and no timeout.
wrkODBC1.LoginTimeout = 60
wrkODBC2.LoginTimeout = -1
wrkODBC2.LoginTimeout = 0
wrkODBC1.Close
wrkODBC2.Close
wrkODBC3.Close
End Sub