Color scheme: Light
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library troubleshooting » Totals stay empty in server mode

Totals stay empty in server mode

A WklGrid with DataMode = wgdServer on a table linked through the Wkl OData driver shows, filters, and groups its records, but the footer and group rows don't show any totals, and SummaryValue returns Null. Distant positions (such as the last record in a large table) take longer than expected.

Environment

WKL Forms Object Library 1.14 and later; tables linked through the Wkl OData driver to a data service that doesn't allow pass-through statements for the caller and doesn't translate sums into OData aggregates.

Cause

In server mode, the grid reads a linked ODBC table over its own connection and requests counts, pages by position (OFFSET … FETCH), and sums. The Wkl OData driver passes anything OData can't express to the data service as a pass-through statement. If the data service doesn't allow pass-through statements for the caller, the driver rejects them with SQLSTATE 42000 or 28000, and the grid reads through the Access database engine instead. That works for every record, but a sum the source rejects stays empty; the grid doesn't report an error on every repaint.

Resolution

  1. Ask the data service administrator to allow pass-through statements for the data source and the caller (part of the data service configuration). The grid then bypasses Access and calculates sums on the server.
  2. Or use a driver and data service that translate sums into OData aggregates ($apply), so that sums work without pass-through.
  3. Or, for a moderately sized source, use memory mode (DataMode = wgdMemory): the grid loads the records once and sums them itself.
  4. Use a query to check whether the source can calculate the sum at all: in the same situation, SELECT Sum(Amount) FROM tblSales in an Access query on the same link fails with “ODBC–call failed.”
en/wiki/msaccess/comctl/troubleshooting/server-mode-totals-empty.txt · Last modified: by Wolfgang van der Stille