Solved

Finding Paradox records from witnin Delphi

Posted on 1998-06-12
2
199 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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