Recent

Author Topic: Paradox Data - trying to use ParadoxDataSet  (Read 3415 times)

cct

  • Newbie
  • Posts: 6
Paradox Data - trying to use ParadoxDataSet
« on: July 19, 2020, 03:06:11 pm »
Hello, I am trying to write a console application to strip data from an old Commercial Delphi program tyhat uses Paradox. In years gone by I used the 32bit Microsoft ODBC, but that does not work in a 64bit world.

I have started using ParadoxDataSet, and can succesfully get records, but am a loss on how to access the actual data. The documentation is a bit light,and I cannot find any example code.

This is with Lazarus 2.0.10 FPC 3.2.0 with TParadoxDataSet 0.2 on Win64


Any pointers?



howardpc

  • Hero Member
  • *****
  • Posts: 4144

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #2 on: July 19, 2020, 03:49:34 pm »
I did not get very happy with the paradox dataset that comes with Lazarus, but I don't remember any details. I was more successful with the TParadoxDataset in CCR (which is also available by Online-Package-Manager) (install the lazparadoxpkg which avoids the naming conflict with the package coming with Lazarus). This component is the same that is used by the demo mentioned by howardpc.

See the simple documentation on https://wiki.freepascal.org/TParadoxDataSet

You may also be interested in my "ParadoxViewer" which is based on this component and allows you to view existing paradox files and export them to SQLite3: https://github.com/wp-xyz/ParadoxViewer
« Last Edit: July 19, 2020, 07:45:05 pm by wp »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #3 on: July 19, 2020, 06:29:01 pm »
If you've already got 32-bit tools for the job, are confident in their use, and have limited time, it might be more practical to work out how to fire up a 32-bit VM on your 64-bit host than to venture into unknown territory.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

cct

  • Newbie
  • Posts: 6
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #4 on: July 19, 2020, 07:35:39 pm »
@howardpc - thanks I have looked at that, but is isbuilt aroud DBGrid, whuch is not what I am after - I want a console application that can read the data, and probably use it to refresh an SQLite DB.

@wp - I am using TParadoxDataSet - I cannot use TParadox, as I am running 64bit. I havew used Paradox Viewer, but will look at the source - many thanks

Chris

cct

  • Newbie
  • Posts: 6
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #5 on: July 19, 2020, 07:38:05 pm »
@MarkMLl - I no longer have them all, and that route was very manual - I want to automate this completely

Chris

cct

  • Newbie
  • Posts: 6
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #6 on: July 19, 2020, 09:15:50 pm »
@wp - Looking at your ParadoxViewer, which seemsto provode an excellent template for what I want to do (as well as learning!) but I cannot get it to compile - it is objecting to ParadoxDataset.PrimaryKeyFieldCount - saying member does not exist.
I have 0.2 of lazparadoxpkg compiled in Lazarus, and the Project Inspector shows it as required.

Am I missing something, or were you using a different version of the package?


TIA


Chris

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #7 on: July 19, 2020, 10:17:14 pm »
I am using the version from CCR (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/tparadoxdataset/). But I just tried also the version from OPM with Laz 2.0.10, and in fact, here is the issue with the PrimaryKeyFieldCount. So, you should get yourself the CCR version, you can use the snapshot if you don't have svn.

[EDIT]
I prepared a new release (0.2.1) which matches the CCR version and asked for addition to OPM.
« Last Edit: July 20, 2020, 12:27:28 am by wp »

cct

  • Newbie
  • Posts: 6
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #8 on: July 20, 2020, 01:45:36 am »
Brilliant - thanks. I will try in the morning

Chris

cct

  • Newbie
  • Posts: 6
Re: Paradox Data - trying to use ParadoxDataSet
« Reply #9 on: July 20, 2020, 04:19:28 pm »
@wp - many thanks, that works very well.

I can now see how to proceed with my plan!

Chris

 

TinyPortal © 2005-2018