RecordSet download

Hi everyone,
I have a problem with recordset and MySQL, I need to interrupt a download of recordset but I can’t. I write an simple example:

Dim Rs as recordSet=DB.SQLSelect(“Select * from myTable”)

now RealStudio starts to download datas but I can’t interrupt it, I tried to execute this code in a thread but if I kill the thread the download continues, this is a problem beacause an user in my application can choose to download a very big table (may be an mistake) and he can’t interrupt this operation.

Another question, can I check Recordset download status? How?

Check out the DownloadContainer.xojo_xml_project example in your Xojo Folder. Might help out

maybe you use LIMIT keyword and only query the fields you need?

Yes, to use LIMIT is a solution but I would like to know how observe progress download. I have a reason, when I do a query I call a view, this view contains a lot of rows, now it can be have about 600000 rows, if I use LIMIT I must interrogate more time the table and this operation can become slow the software.

I would grab the record count first by executing COUNT then process in appropriate size chunks by using LIMIT on my SELECT.

Thanks for your replies, I will use yours advice, I will create a class to create a temporary table to write result of query (in this system I must do 1 call to the view) and after I will download datas from temporary table using limit. I’m interested to this because I want to know dimension of data to download, to get valued time to end of download ecc.
Creating a good class I will use it in all project to download big datas and I will use it in threads.

There is no way to interrupt the transfer of data or to monitor its progress.

600000? Sounds you may have other problems.

One thing could be to make sure you have server side records, so only one at a time is transferred and not all of them.
With MBS SQL plugin you can specify how many records are loaded in a batch. And of course turning off Scrollable feature will help in this case. (scrollable cursors are often client side)

I don’t allow to the user to download all, only if he want make a backup he can.
Normally the user downloads less datas in one time, but if he try to download too datas the program allow to interupt the download.
I just finished the class, it is only a base but works :slight_smile: