#1 2011-07-07 19:57:23

ingoberg
Member
Registered: 2010-11-20
Posts: 17

Add a record to the TSQLTable Object

I have a grid that I use to display thousands of records. I retrieve the records with a call such as cust:= TSQLCustomer.CreateAndFillPrepare(globalClient, ''). After I have retrieved the records and displayed in my grid, I would like to add a new record, but the problem is that I don't want to have to call .CreateAndFillPrepare after having added the new record to the database. I know that the records that are retrieved via the TSQLCustomer object are stored in the FillTable (TSQLTable). Is there anyway to add the new record to this table after the record has been successfully added to the database or is this perhaps the wrong approach?

Offline

#2 2011-07-08 05:35:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Add a record to the TSQLTable Object

There is now way of modifying the TSQLTable content. It's read-only per nature.

Because of the stateless architecture, the whole table has to be retrieved from the server.
See the documentation on this purpose.
In practice, due to server-side caching, and a global state indicator retrieved from server, it's very fast: data is retrieved only if necessary.

So you make you TSQLCustomer.Add() then a refresh on the table.

Offline

Board footer

Powered by FluxBB