Solved

Finding Paradox records from witnin Delphi

Posted on 1998-06-12
2
202 Views
Last Modified: 2010-04-03
I have a paradox 7 table with two keys, the primary key is a field called ID and the secondary key is a field called CWWORD.  I have a normally edit component on a form in which the user enters the word they want to search for.

What need to do is determine whether the record exists.

This is what I think is the correct method of doing this :)

Table.Active := True;
Table.IndexName := CWWORD;
if Table.FindKey(Edit.Text) then
  record found
else
  record not found;

This piece of code doesn't work but but I know it's something similiar.  Can you help ?

0
Comment
Question by:neld
2 Comments
 

Accepted Solution

by:
jhun earned 20 total points
ID: 1352429
The findkey takes an array of const as a parameter. Try this:

with Table do
begin
  EditKey;
  FieldByName('CWWORD').AsString := Edit.Text;
  if GotoKey then
   rec found
  else rec not found

gr. John

end;
0
 

Expert Comment

by:bijoyn
ID: 1352430
since u know that the fieldname is ID what u can do is

if Table1.Locate('ID',Edit1.Text,[]) then
   Showmessage('Found')
else
   Showmessage('Not Found');

----------------------
The above code should help find the records u are looking for in a table. If the key has multiple columns then separate the column names by comma. and the same for the values which will be shown as [value1, value2...] etc.

Bijoy

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

861 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