Copy data to tBufDataSet lazarus / 16-Databases ---------------------------------------------------------------------- cappe · 2017-09-06 10:10 I'm looking for the fastest method of copying a TZQuery (ZEOS) content (data) to a TBufDataSet. It's urgent ... ---------------------------------------------------------------------- rvk · 2017-09-06 10:34 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i BufData.CopyFromDataset(Query1, true);where BufData is a TBufDataSet and Query1 is TZQuery. ---------------------------------------------------------------------- cappe · 2017-09-06 14:07 Quote from: rvk on September 06, 2017, 12:34:44 pmCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i BufData.CopyFromDataset(Query1, true);where BufData is a TBufDataSet and Query1 is TZQuery. Good, but I use Lazarus 1.2.6 e con not find CopyFromDataset. where can I find it or how can I do it? ---------------------------------------------------------------------- rvk · 2017-09-06 15:02 You could upgrade to a newer version where TBufDataset does have the function. Otherwise you could try using TMemDataset (which had this function a lot longer). I'm not sure what the downside would be for using TMemDataset. Maybe others can explain. This page does give a remark about it: http://wiki.freepascal.org/How_to_write_in- memory_database_applications_in_Lazarus/FPC QuoteNote: later on in this article, BufDataset is introduced. TBufDataset often is a better choice than TMemDataset So I'm not sure if you really need TBufDataset or if you can use TMemDataset (from memds). ---------------------------------------------------------------------- cappe · 2017-09-07 04:20 Quote from: rvk on September 06, 2017, 05:02:47 pmYou could upgrade to a newer version where TBufDataset does have the function. Sorry, it's not so long that I use lazarus. How do I upgrade to the new version of TBufDataset with Lazarus 1.2.6? p.s.: Thanks for the previous answer ---------------------------------------------------------------------- rvk · 2017-09-07 07:35 Quote from: cappe on September 07, 2017, 06:20:10 amHow do I upgrade to the new version of TBufDataset with Lazarus 1.2.6? You can download the newest Lazarus 1.6.4 from the Lazarus homepage. I'm not sure if you can just install over your current 1.2.6 but you can uninstall that one and install the new 1.6.4. Also notice that the default download for 1.6.4 now matches your OS bitness. So if you have a 64 bit Windows you now default get a 64 bit Lazarus. If you still want the 32 bit version (for compatibility issues or otherwise) you can click on "Other" and choose your version. ---------------------------------------------------------------------- Almir.Bispo · 2017-09-07 12:45 Try using Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var M:Tmemorystream;beginM:=Tmemorystream.create;Query.savetostream (M);Buf.loadfromstream (M);end; (Verify that both methods exist respectively) http://adltecnologia.blogspot.com.br ---------------------------------------------------------------------- cappe · 2017-09-07 16:52 Quote from: Almir.Bispo on September 07, 2017, 02:45:35 pmTry using Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var M:Tmemorystream;beginM:=Tmemorystream.create;Query.savetostream (M);Buf.loadfromstream (M);end; (Verify that both methods exist respectively) http://adltecnologia.blogspot.com.br ZQuery does not have savetostream. copyfromdataset is slow for many data. Other solutions? ---------------------------------------------------------------------- Almir.Bispo · 2017-09-07 17:33 look at this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   zquery1.Properties.SaveToStream(M); ---------------------------------------------------------------------- cappe · 2017-09-08 05:40 Quote from: Almir.Bispo on September 07, 2017, 07:33:04 pmlook at this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   zquery1.Properties.SaveToStream(M);  But in BufDataSet.loadfromstream I get an error "EDataBaseError" The data-stream format is not recognized. How do I fix it?