Make tables without a row version editable
A table without a row version can't be changed safely over OData and from Access: there's no value by which someone else's change could be detected, and the ODBC driver refuses changing and deleting. A computed row stamp closes this gap without changing the schema.
Solution overview
For enabled tables, the service computes a checksum over all stored columns and offers it as a row
version (column gw_rowstamp). How it's computed and what it doesn't do:
Writing and write conflicts.
An entry names the tables in one of three forms; case doesn't matter:
| Entry | Meaning |
|---|---|
schema.tabelle | this one table |
schema.* | every table of the schema |
* | every table of the data source |
Implementation
With an administration store (administration app):
- Open Datenquellen (Data sources), and expand the data source with the arrow at the start of the row.
- On the Tabellen-Einstellungen (Table settings) tab, add a row: Einstellung (Setting)
row_stamp, Muster (Pattern) such asdbo.Rolle. - Leave the row. A pattern in any other form is rejected.
Without an administration store (configuration file): add to the data source's entry, and restart the service:
{ "Name": "fachdaten", "Provider": "sqlserver", "ConnectionString": "…",
"RowStampTables": [ "dbo.Rolle", "stamm.*" ] }
Then, in both cases:
- In Access, refresh the links of the tables (External Data > Linked Table Manager) so that Access knows the
gw_rowstampcolumn. - Check: the schema document names
gw_rowstampfor the table, and a change in Access succeeds; someone else's change in between results in the familiar write conflict.
Notes
- No stamp is given to a listed table without a unique key, a table that itself has a column
gw_rowstamp, or a table with a column type the checksum doesn't cover—a stamp that left out a column would miss every change to it. When the catalog is loaded, the log names the table and the reason (Zeilenstempel fuer … nicht moeglich(row stamp for … not possible)). - A table with a row version keeps it, even under
*. - Views don't get a stamp.
RowStampTablesapplies only to tables; a pattern such asdbo.*doesn't match the schema's views, and a view is offered without a stamp. If a view selects the row version column of its base table, the service reports that column as its row version; Access then edits a linked view over a single table like a table. Without such a column, a linked view stays read-only in Access. Where users edit, link the base table for writing and the view for reading. - Where the schema may be changed, a real row version column is the better answer: exact, maintained by the database, and free when reading. The stamp is computed over every column on every read.
Related topics
en/wiki/data-conectivity/database-gateway/how-to/enable-row-stamps.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille