Advertisement
Advertisement
| 07.20.2008 at 07:18PM PDT, ID: 23580780 |
|
[x]
Attachment Details
|
||
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.
|