Subject | first steps: query and cursor |
---|---|
Author | Boris Schlüszler |
Post date | 2001-11-30T22:19Z |
Hello!
For looking up city-names on zips I today coded this routine:
with IB_Cursor1 do begin
ParamByName('plz').AsString:=Edit1.Text;
Open;
while not Eof do begin
ComboBox1.Items.Add(Fields[2].AsString);
Next;
end;
Close;
end;
Did I get that correctly?
I've got the feeling, this routine may still be optimized:
Can I save the Open/Close-routines somehow?
What is better to use: Query or Cursor?
Should I Unprepare after using?
Is preparation made automatically?
Do I need preparation anyway?
Regards, Boris
For looking up city-names on zips I today coded this routine:
with IB_Cursor1 do begin
ParamByName('plz').AsString:=Edit1.Text;
Open;
while not Eof do begin
ComboBox1.Items.Add(Fields[2].AsString);
Next;
end;
Close;
end;
Did I get that correctly?
I've got the feeling, this routine may still be optimized:
Can I save the Open/Close-routines somehow?
What is better to use: Query or Cursor?
Should I Unprepare after using?
Is preparation made automatically?
Do I need preparation anyway?
Regards, Boris