How to simulate an ODBC timeout error?

I am testing the error handling of a process controlled by Access-VBA:

  • A script in the Access controller runs DB.
  • The script runs the macro in the second access file ("database").
  • A macro in a database file launches many requested queries.
  • These queries are retrieved from the tables associated with the ODBC source (actually SQL-Server).

When this process runs in the early morning hours, sometimes timeout requests. Today I updated the error handling in the script controller, so I want to simulate a timeout error.

I looked at the ODBC administrator and advanced options in MS Access, but I do not find what I need. Ideas?

+3
source share
4 answers

Open the macro in view mode. From the View menu, select Properties. This should be a Timeout property, set it to a short value and test.

+2
source

re: sometimes request timeouts.

Make sure that the query property for the ODBC timeout is set to 0, so it does not generate an error, but continues to work.

+1
source

SQL- - .

--waits for 5 mins
    WaitFor Delay '00:05'

, , , . 3

begin transaction

Select *
From MyTable with (TABLOCKX)
--wait for 3 min
WaitFor Delay '00:03'

rollback transaction
0

, , WAITFOR. .

0

Source: https://habr.com/ru/post/1766249/


All Articles