Solved

Search problems HELP!!!!!!!

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

Industry Leaders: 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
Intraweb submit form as a POST request 4 350
QRReport  TQrmemo vertical stretching 1 55
JAudiorecorder record freezing the app 29 82
DBCtrlGrid, Delphi, Scroll 8 55
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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 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