Advertisement

07.20.2008 at 07:18PM PDT, ID: 23580780
[x]
Attachment Details

Why my code for wild card search is not working

Asked by firekiller15 in Delphi Programming Language, Delphi Programming

Tags: delphi

Delphi

Why my code for wild card search is not working.
I have a text edit box and a search button

i want to get value from database and display it on a screen
example if i type a the data value that has a will display on the screen.

my problem is i cannot perform wild card search.

below is my code to do this


Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
ViewStudentName:TvirtualStringTree;//declare
 
  declare 
  Rec = ^ARec;
  ARec = record
  StudentNameDisplay: string;
  
//search button
procedure TForm.searchbtnClick(Sender: Tobject);
var
  EditStudentName: string;
  Node: PVirtualNode;
  ViewRec: Rec;
 
begin
EditStudentName :=  '%' + Trim(editTextBox.Text) + '%';  //wild card search
   
      Clear;
      Add('SELECT StudentName FROM STUDENTABLE WHERE StudentName = getstudentName');//database
      ParambyName('getStudentName').AsInteger := EditstudentName;
      
      Open;
 
      while (not EOF) do //while not EOF print result on screen
      begin
          vstViewProject.NodeDataSize := SizeOf(ARec);
          Node := ViewStudentName.AddChild(nil);
          ViewRec := ViewStudentName.GetNodeData(Node);
          with ViewRec^ do
          begin
            StudentNameDisplay:= FieldByName('StudentName').AsString;
 
 
my problem is i cannot perform wild card search.
 
Keywords: Why my code for wild card search is n…
 
Loading Advertisement...
 
[+][-]07.20.2008 at 07:22PM PDT, ID: 22047747

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Delphi Programming Language, Delphi Programming
Tags: delphi
Sign Up Now!
Solution Provided By: TheRealLoki
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.20.2008 at 07:22PM PDT, ID: 22047746

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.20.2008 at 07:25PM PDT, ID: 22047753

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.20.2008 at 07:45PM PDT, ID: 22047798

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.20.2008 at 07:47PM PDT, ID: 22047801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.20.2008 at 07:47PM PDT, ID: 22047804

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628