Recent

Author Topic: Porting from Borland Delphi BDE TQuery, TTable, TDatabase, TSession, etc  (Read 20032 times)

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
By the way, I had the same problem, having to port something like a TTable to lazarus, so I made my own TSQLTable- Component that is based on the TSQLQuery
have a look at my github-repository under Components\Source\SQLTable
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
His problem is that the tables are dbf.... Anything SQL won't work. Except odbc to some extend. dBase has its own query language.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
So you can bind The TSqlTable to a TODBCConnection
[edit]... i think i learned SQL with dbase in school back in the 80's
« Last Edit: May 08, 2017, 09:05:52 pm by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
Then you are mistaken. In the 80's there was no sql with dBase.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
dBase III+ might not have had the ability to use SQL for queries, but my application uses the BDE and SQL works quite well, at least for simple expressions. For instance:

Code: Pascal  [Select][+][-]
  1. SQL.Strings = (
  2.       'SELECT TECHID FROM ORTTECHS ORDER BY TECHID'
  3.     )

I also have a memo where the SQL is displayed, and can be edited by the user. It is partially automated, where the user can select a field from a list to be added to the SQL statement, as shown in the following screenshot from my original application, and a sample report:

« Last Edit: May 08, 2017, 09:48:37 pm by PStechPaul »


Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
Yes, I know all that... At the time I was rather involved with Borland because I did some research for them. I also worked on a product called PerfectView that is basically a dBase format based database design software that did not use the BDE. But you want to drop the use of the BDE since it is deprecated and in Lazarus there's no direct interface for it. This can all be mitigated, but I understand you want to keep the dBase format and that will take more work than you think. We can discuss this directly.
« Last Edit: May 09, 2017, 06:49:42 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
As long as the old dBase files can be converted to another format, there is no reason to keep the dBase files for the new application. It could be done as part of the install process. I found several utilities that can do this.

http://www.dbf2002.com/dbf-converter/convert-dbf-to-sql.html

http://download.cnet.com/DBF-to-MySQL/3000-2065_4-10534440.html

https://dbf-to-sql-converter.en.softonic.com/


jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
(off topic:)
@Thaddy:
See Wikipedia:

https://en.wikipedia.org/wiki/DBase#dBase_.2F_xBase_programming_language
Quote
...
Over time, Ashton-Tate's competitors introduced so-called clone products and compilers that had more robust programming features such as user-defined functions (UDFs) to supplement the built-in function set, scoped variables for writing routines and functions that were less likely to be affected by external processes, arrays for complex data handling, packaging features for delivering applications as executable files without external runtime interpreters, object-oriented syntax, and interfaces for accessing data in remote database management systems. Ashton-Tate also implemented many of these features with varying degrees of success. Ashton-Tate and its competitors also began to incorporate SQL, the ANSI/ISO standard language for creating, modifying, and retrieving data stored in relational database management systems.
...
(on Topic:)
Any comments on TSQLTable helping to convert Delphi programs to Lazarus ?
« Last Edit: May 09, 2017, 09:53:04 am by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
As long as the old dBase files can be converted to another format, there is no reason to keep the dBase files for the new application. It could be done as part of the install process. I found several utilities that can do this.

http://www.dbf2002.com/dbf-converter/convert-dbf-to-sql.html

http://download.cnet.com/DBF-to-MySQL/3000-2065_4-10534440.html

https://dbf-to-sql-converter.en.softonic.com/
This can be done straight from lazarus with default components, btw. There's a lot of noise here. I am probably the only one in this discussion that actually worked for Borland. On dBase format  related things.
So the links aren't very helpful if you don't know it can be done already within the Lazarus provided infrastructure.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Then you are mistaken. In the 80's there was no sql with dBase.
He was close. In 1991 Fox Pro 2.0 for DOS had SQL queries over DBF tables.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
Then you are mistaken. In the 80's there was no sql with dBase.
He was close. In 1991 Fox Pro 2.0 for DOS had SQL queries over DBF tables.
Correct. But the tables and indexes aren't compatible. Fox Pro and dBase were like fire and water if you mixed them.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
I've tried to connect DBF with ODBC and started a query on it.
I was not not very font of it :D
« Last Edit: May 10, 2017, 08:09:13 am by mangakissa »
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
(still off topic)
It was late '89 maybe begin of '90 and it was a very early release of dBase. We didn't call it SQL those days, we just learned dBase. But when i later had a look at SQL i realized the similarities.
I still know after the query you had to call the browse command to get a data table, btw. it was DOS, so no graphic ..., but EGA so 80x43
 
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

 

TinyPortal © 2005-2018