I suppose one could literally consider Delphi code written using Lookup, Locate, etc... as a query. In general, when one refers to a database query, one is referring to a Structured Query Language (SQL) statement constructed to either read or write data from or to a table or tables. SQL is literally different and separate from Delphi. Delphi is essentially object oriented PASCAL for a Win32 environment. SQL statements are typically found in one of three locations: 'embedded' in a program such as one written in Delphi, 'embedded' in a Stored Procedure or the like in a database, or stored in a field of a table in a database.
Do you have access to the Delphi code that uses the BDE? If so, are there any TQuery components on the TForm or in a Data Module? If so, take a look at the "SQL" in the "Object Inspector", you will likely find an SQL statement there. If not there search the Delphi code for ".SQL".
The Lookup, Locate, First, and Next statements are member functions of TDataSet. The Direct Access Components I mentioned earlier are descendants of TDataSet.
A Data Aware Control is anything that does what it is intended to do when data is available. For example, a TDBGrid will display data as soon as data is made available to it by a TDataSource. A TDataSource will make available the data to a TDBGrid as soon as data is made available to it from a TDataSet. TTable and TQuery are both descendants of a TBDEDataSet.
Imagine you placed on a TForm the following: a TButton, a TDBGrid, a TDatabase, a TQuery, and a TDataSource. Now imagine a table:
family_names
------------
FamilyMemberID LastName FirstName
1 Doe Jane
2 Doe John
3 Smith Mary
4 Smith Mike
Let's construct an SQL statement:
Code:
SELECT FamilyMemberID, CONCATENATE(FirstName, ' ', LastName)
FROM family_names
WHERE LastName = 'Smith';
In the "Object Inspector" of the TQuery, you assigned the SQL statement (query). For the event covered by the TButton, you Open()'ed the TQuery.
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
Query1.Open;
end;
Data is now in memory and is made available from the TQuery to the TDBGrid via the TDataSource. Because TDataSource and TDBGrid are both data aware, I do not have to explicitly handle that in my code. Suddenly the TDBGrid shows the data. Now then, for whatever reason, if I decided to look up (yes, Lookup) the FamilyMemberID based on a specified concatenated first and last name, I can use the Lookup method made available by the TQuery.
I think, after the data from your back office source is moved from Paradox tables to ??? (MySQL, MsSQL, Oracle, FirebirdSQL, whatever), you will find most Direct Access Components will make it so you only have to update the text in your Delphi program(s) to replace all the references to the current BDE related queries and tables. I would imagine even the embedded SQL statements would be 'transportable' and not require significant changes. It is possible MySQL would not be appropriate for this project, but I would imagine it would work nicely. That said, if you adopt MySQL and the DAC from microolap, I am confident the project would go smoothly.
By the way, I swear I do not work for microolap, I have just had good success with them...
Steve.