Recent

Author Topic: (Solved) Databases Union in a single DBF  (Read 3305 times)

InfoMan

  • New Member
  • *
  • Posts: 49
(Solved) Databases Union in a single DBF
« on: April 22, 2012, 05:58:48 am »
I have the databases A2007.DBF, A2008.DBF, A2009.DBF, A2010.DBF, and A2011.DBF A2012.DBF that have recorded data of the years 2007 to 2012. Necessary to unite them all in a single database called ANOS.DBF. How do I do this? What better way to do this? Many thanks to all who respond.
« Last Edit: April 25, 2012, 04:16:04 am by InfoMan »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Databases Union in a single DBF
« Reply #1 on: April 22, 2012, 10:00:11 am »
Infoman, what have you tried?

I'd open all the dbfs in a loop. In each dbf, loop through the tables. In each loop, loop through the data and write it out to your consolidated ANOS.DBF.

This is the naive way of doing things, but I don't think there's any quicker way of doing it. Of course, please prove me wrong ;)

I'm sure you must have thought of this; it might have been nice if you had described it, along with your operating system, Lazarus/FPC version:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum_.3F
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

InfoMan

  • New Member
  • *
  • Posts: 49
Re: Databases Union in a single DBF
« Reply #2 on: April 22, 2012, 03:18:30 pm »
Sorry, forgot to put this information.

Yesterday I upgraded my Lazarus to version 1.1 (04.22.2012), FPC 2.6.1. Unfortunately I'm using Windows 7 32 Bit. I do not like Windows, although the use of professional issues.

I made it through a loop as you said.

I was having a problem that the report was based on the result file showing blank records that should already be closed. I wondered if he had the wrong file generation, but then discovered that the cases were actually open, although already having closed earlier closing them is not recorded and kept open, although I believe they were closed.

Thank you for your attention.

 

TinyPortal © 2005-2018