Recent

Author Topic: clone dataset  (Read 6190 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
clone dataset
« on: December 12, 2013, 05:19:55 pm »
How do I clone a dataset connected to a dbgrid?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: clone dataset
« Reply #1 on: December 12, 2013, 06:41:41 pm »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8731
  • FPC developer.
Re: clone dataset
« Reply #2 on: December 12, 2013, 06:55:20 pm »
Isn't there a TMemdataset.CopyFromDataset to make that easier?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: clone dataset
« Reply #3 on: December 12, 2013, 07:19:40 pm »
Yes, but xinyiman didn't say what kind of dataset he's using.  Bufdataset etc have no copyfromdataset. I also recall Lacak2 posting a method using savetostream/readfromstream somewhere else in the forum.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8731
  • FPC developer.
Re: clone dataset
« Reply #4 on: December 12, 2013, 07:25:57 pm »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: clone dataset
« Reply #5 on: December 12, 2013, 07:32:09 pm »
Maybe OP would like to provide a patch ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: clone dataset
« Reply #6 on: December 12, 2013, 08:31:35 pm »
I need a method that clones a dataset any, I want to be able to reuse the method.
However, my dataset is of type TBufDataSet and I want to consult it without interacting with the original TBufDataSet.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: clone dataset
« Reply #7 on: December 12, 2013, 08:55:58 pm »
Did you read the code in the link I posted? Did you try it? What didn't work? What error messages do you get?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: clone dataset
« Reply #8 on: December 12, 2013, 09:08:17 pm »
And I need to clone the dataset during the event BeforePost the dataset. This sends the loop the program.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: clone dataset
« Reply #9 on: December 12, 2013, 09:19:17 pm »
Ok. Let us know how that goes.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: clone dataset
« Reply #10 on: December 12, 2013, 09:24:18 pm »
Maybe addressing the root problem solve the same, you know, tell me how to set the TBufDataset in such a way that the column does not allow duplicate article? So I would answer.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: clone dataset
« Reply #11 on: December 12, 2013, 09:33:30 pm »
Sorry, not interested in continuing without info. Bufdataset source code is open; you can have a look yourself.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

xinyiman

  • Hero Member
  • *****
  • Posts: 2092
    • Lazarus and Free Pascal italian community
Re: clone dataset
« Reply #12 on: December 12, 2013, 09:35:36 pm »
ok thank you
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018