Solved

Search problems HELP!!!!!!!

Posted on 1997-04-23
5
142 Views
Last Modified: 2010-04-04
I'm writing a program toenrool students in which I use a table called TaCursist where the indexfieldnames are Volgnr,naam,voornaam. If i try to make a search for a name he doesn't find him. I use the following code:
SetKey;
FieldByName('naam').AsString := Edit.text;
Gotokey;
How can I solve this. Please help me, it's urgent
Thanx, Tom
0
Comment
Question by:940216td
[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
  • 3
5 Comments
 
LVL 1

Expert Comment

by:Heapster
ID: 1335633
I dont do much database programming at the moment, but dont you have to set up a query, and pass that to the database.
Im really not sure what the question is : are you trying to execute a search on a single field of your database?
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335634
You'll only find the name if the field 'naam' has an index, otherwise,you'll have to use an SQL component in this way:

SELECT * FROM TACURSIST WHERE NAAM= :PNAAM

where PNAAM is a parameter passed like this:

{Set param type in  TQuery properties}

Query1.Close;
Query1.Params[0].AsString:=Edit1.Text;
Query1.Open;
0
 

Author Comment

by:940216td
ID: 1335635
How do I put an index on field Naam?
HELP!!!!!!!!!!!!!!!!!!
0
 
LVL 2

Accepted Solution

by:
javiertb earned 100 total points
ID: 1335636
Just go to Database Desktop, open the table, reestructure, and then set the field you want to have an index. It's quite simple.
The index of a table is usually a code or similar and in your case you want to have an index at alumn name, so, it's up to you.
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335637
Are you using an SQL server? (Look at Delphi on line help for IndexFieldNames).
If not, just use the index field alumn number in the table and use IndexFiles and IndexName properties.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to center only a line in richedit? 4 78
How to make Sign in, using Clientdataset? 1 43
How to save the image in the .cds File ClientDataSet? 1 42
Delphi, TImage, Png 2 54
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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