Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Database question (begginer)

Posted on 1999-01-06
2
Medium Priority
?
152 Views
Last Modified: 2010-04-04
I have delphi 3.0 and i need to know which components do I need to use to compare two databases *.dbf .I need to compare two fields from different databases.
0
Comment
Question by:Dark_Man
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
Oli2 earned 150 total points
ID: 1355009
Just use two TTables.

var: nmatch : Integer;
while ( not Table1.EOF ) or ( Table2.EOF ) do
begin
if Table1.Fields[3].AsString = Table2.Fields[9].AsString then inc ( nmatch );
Table1.Next;
Table2.Next;
end;

This would compare the 3rd Field of Table1 with the 9th Field of Table2.
It would compare it record for record tough.

Is that what you needed ?

Greetings, Oli
0
 
LVL 1

Expert Comment

by:martin_g
ID: 1355010
You need to first have two table components (and two datasource components attached to those tables if you are going to display the information).

For example:
Table1 with DataSource 1
Table2 with DataSource 2

Now for some code:

Table1.Open;  {activate the table and go to the first field}
Table2.Open;
if Table1FIELDTOCOMPARE.Value = Table2.FIELDTOCOMPARE.Value then
  do something; {this compares the values of the fields "FIELDTOCOMPARE" in the first record of TAble 1 and Table2}

If you need to find a value (such as a lookup table or need to loop through a table, let me know and I'll show you how).

Hope this will get you started.



0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question