* * *

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

jc99

  • Hero Member
  • *****
  • Posts: 509
    • 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.2 - 1.6.4, 1.8rc3
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are

Thaddy

  • Hero Member
  • *****
  • Posts: 4025
His problem is that the tables are dbf.... Anything SQL won't work. Except odbc to some extend. dBase has its own query language.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

jc99

  • Hero Member
  • *****
  • Posts: 509
    • 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.2 - 1.6.4, 1.8rc3
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are

Thaddy

  • Hero Member
  • *****
  • Posts: 4025
Then you are mistaken. In the 80's there was no sql with dBase.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

PStechPaul

  • Jr. Member
  • **
  • Posts: 72
    • 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: 4025
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 »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

PStechPaul

  • Jr. Member
  • **
  • Posts: 72
    • 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: 509
    • 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.2 - 1.6.4, 1.8rc3
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are

Thaddy

  • Hero Member
  • *****
  • Posts: 4025
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.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

avra

  • Hero Member
  • *****
  • Posts: 1049
    • 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 - Easily convert components and projects between Lazarus and CodeTyphon

Thaddy

  • Hero Member
  • *****
  • Posts: 4025
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.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

mangakissa

  • Hero Member
  • *****
  • Posts: 689
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 1.64 (32b) / FPC 3.0
Windows 10

jc99

  • Hero Member
  • *****
  • Posts: 509
    • 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.2 - 1.6.4, 1.8rc3
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus