Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 29 Mar 2024, 15:31

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 10 Oct 2019, 16:40 
Offline

Joined: 21 May 2012, 12:29
Posts: 9
Hello.

I have DBGridEh linked to MemTableEh (ReadOnly) with a huge data, and I can change a data record by other controls (DBEdit, DBLookUpComboBox...).

> Is it possible to Refresh a single record values from the DataBase (From DataDriver) without refreshing all records (MemTableEh.Refresh)?


Top
 Profile  
 
PostPosted: 10 Oct 2019, 17:04 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

There is a method
procedure TMemTableEh.RefreshRecord;
which is intended to re-read record from the server through the DataDriver.

But the operation of this method depends on whether it is implemented in TDataDriverEh.

For example TADODataDriverEh supports this method and calls GetrecSQL.
GetrecSQL should contain a query that returns a single record.
like this
Code:
      'select *'
      'from'
      '  vendors'
      'where'
      '  VendorNo = :OLD_VendorNo'.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 11 Oct 2019, 05:20 
Offline

Joined: 21 May 2012, 12:29
Posts: 9
Thanks,

T try to use TSQLDataDriverEh but no result.
When execute TMemTableEh.RefreshRecord with TDataSetDriverEh the TMemTableEh reload all records.

Currently, I use the code below, but I'm looking for another better solution than this one.

Code:
    CurrentId:=MemTableEh.FieldByName('ID').Value;
    FDQuery.Refresh;
    FDQuery.Locate('ID', CurrentId, []);
    for i := 0 to MemTableEh.Rec.DataStruct.Count-1 do
     begin
     DataSetDriverEh.AssignFieldValue(MemTableEh.Rec.DataStruct.MemTableData, MemTableEh.Rec, i,
     dvvRefreshValue, FDQuery) ;
    end;
   DBGridEh.Invalidate;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group