?
Solved

Finding Paradox records from witnin Delphi

Posted on 1998-06-12
2
Medium Priority
?
205 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
[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
 

Accepted Solution

by:
jhun earned 60 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

771 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