Color scheme: Light
You are here: start » en » Documentation » Data integration and data access » WKL OData ODBC Driver » Troubleshoot the OData ODBC driver » Access hangs at GetRows

Access hangs at GetRows

Code that reads a linked table with Recordset.GetRows doesn't return; Access stops responding and has to be ended. With MoveNext over the same table, error 3146 “ODBC–call failed” appears instead.

Environment

Access or DAO with linked tables, with any ODBC driver, including Microsoft ODBC Driver 18.

Cause

If a next page fails while reading further – for example because of the service's request limit (429), a time limit, or a network interruption – the driver reports the error (SQL_ERROR). GetRows then calls SQLFreeStmt(SQL_CLOSE) endlessly and never returns, regardless of the SQLSTATE. With the SQL Server driver, it's the same, for example with a view that divides by zero in the middle of reading. It's a behavior of DAO, not of the driver.

Resolution

  1. Replace GetRows with a loop using MoveNext:

    Do Until rs.EOF
        ' … process …
        rs.MoveNext
    Loop

    On the same error, MoveNext returns immediately with 3146, and your error handling takes over.

  2. Find the actual error while reading further with the trace. Against the data service, next pages don't count against the request limit; a 429 while reading further points to self-built next-page addresses or a different service.

Verification

The same operation ends with an error message instead of hanging, or it runs through.

en/wiki/data-conectivity/odata-odbc/troubleshooting/getrows-hangs.txt · Last modified: by Wolfgang van der Stille