Solved

Search problems HELP!!!!!!!

Posted on 1997-04-23
5
143 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

624 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