View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Poppe Poppe is offline
external usenet poster
 
Posts: 16
Default Tough one - Timeout doesn't work

Hi

I send data from Excel to database with ADO connection.

Sometimes other users with other programs use the database, and reserve
access.

I need to define timeout parameter for the ADO connection, so it doesn't
hang and wait forever if the database is in use by somebody else.

I've tried several options:

--------------

Dim conn As New ADODB.Connection
conn.ConnectionTimeout = 5
conn.CommandTimeout = 5

Dim cmdSQLData As ADODB.Command
Set cmdSQLData = New ADODB.Command
cmdSQLData.CommandTimeout = 5

--------------

Nothing works. It doesn't give error after 5 seconds, but hangs and waits
until the database access is released by another program.

Please help!!