Hello,
I need to save the rows of a TMyQuery and load the save file back at user demand (just like with TVirtualTable).
How can I do that?
Thank you very much!
TMyQuery : save / load data?
Re: TMyQuery : save / load data?
If you want to save a query execution result, and then open it - you can do it using the VirtualTable component.
You can use methods SaveToFile and LoadFromFile for data loading and saving in VirtualTable on all the supported platforms. Data will be saved as binaries. You can assign a TMyQuery to a TVirtualTable. You can read about to fill TVirtualTable with data from another TDataSet component in the VirtualTable help: https://devart.com/virtualdac/docs/inde ... bject).htm For example:
If you mean something else, please write to us in more detail.
You can use methods SaveToFile and LoadFromFile for data loading and saving in VirtualTable on all the supported platforms. Data will be saved as binaries. You can assign a TMyQuery to a TVirtualTable. You can read about to fill TVirtualTable with data from another TDataSet component in the VirtualTable help: https://devart.com/virtualdac/docs/inde ... bject).htm For example:
Code: Select all
VirtualTable.Assign(MyQuery);
Re: TMyQuery : save / load data?
Hello,
Thank you for the answer. I will describe the situation so as you would understand my problem:
- There is a grid connected to a TMyQuery
- The TMyQuery is connected to a temporary table
- The user adds new records, and fills the different field values
He should be able to save all the data in database (under a certain name), close the program, open it a few days later and load the selected save back into the grid (TMyQuery).
If I use your solution, and Assign to a TVirtualTable, I can save the data indeed.
But is there an easy way to load data from TVirtualTable back to TMyQuery? (without iterating all the records)
Thank you very much!
Thank you for the answer. I will describe the situation so as you would understand my problem:
- There is a grid connected to a TMyQuery
- The TMyQuery is connected to a temporary table
- The user adds new records, and fills the different field values
He should be able to save all the data in database (under a certain name), close the program, open it a few days later and load the selected save back into the grid (TMyQuery).
If I use your solution, and Assign to a TVirtualTable, I can save the data indeed.
But is there an easy way to load data from TVirtualTable back to TMyQuery? (without iterating all the records)
Thank you very much!
Re: TMyQuery : save / load data?
The similar question has already been discussed on our forum. Follow the link viewtopic.php?f=6&t=26963 for details.
If it doesn't help to solve the issue, please compose a full sample demonstrating the issue including the script for creating and filling in the database objects and send it to us via form e-support: https://devart.com/company/contactform.html
If it doesn't help to solve the issue, please compose a full sample demonstrating the issue including the script for creating and filling in the database objects and send it to us via form e-support: https://devart.com/company/contactform.html
Re: TMyQuery : save / load data?
Hello Victor,
Thank you for your reply. The link you gave me linked to a "Access violation on Win32 target" topic ...
Thank you
Thank you for your reply. The link you gave me linked to a "Access violation on Win32 target" topic ...
Thank you
Re: TMyQuery : save / load data?
We changed the link to the correct one.