Does not work Insert() when CachedUpdates is true

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Fastex
Posts: 15
Joined: Wed 20 Oct 2010 08:52

Does not work Insert() when CachedUpdates is true

Post by Fastex » Tue 26 Apr 2011 07:19

Hello,

I use UniTable with property "CachedUpdates" = true. If I try run my project with "CachedUpdates" = true then method Insert doesn't work. If I try with "CachedUpdates" = false, Insert works. I need to use CachedUpdates and method Insert. How can I do this?

A lot of thanks.

AndreyZ

Post by AndreyZ » Tue 26 Apr 2011 11:43

Hello,

Try using the following code:

Code: Select all

UniTable.TableName := 'your_table';
UniTable.CachedUpdates := True;
UniTable.Open;
UniTable.Insert;
// fill field values, for example, UniTable.FieldByName('your_int_field').AsInteger := 1;
UniTable.Post;
UniTable.ApplyUpdates;
If it doesn't work on your machine, please specify the following:
- the exact version of UniDAC. You can learn it from the About sheet of TUniConnection Editor;
- the exact version of your IDE;
- the exact database server you are working with.

Post Reply