Solved

Database question (begginer)

Posted on 1999-01-06
2
149 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
2 Comments
 
LVL 1

Accepted Solution

by:
Oli2 earned 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Machine not responding during CopyFile() 3 104
how to manage invalidate between two tvirtualstringtree in same form? 1 130
Dynamically Created Query 3 62
DBGrid or StringGrid ? 6 105
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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