
02.03.2013, 15:24
|
Прохожий
|
|
Регистрация: 16.02.2013
Сообщения: 13
Репутация: 10
|
|
Забыл указать. Delphi 2010.
Компоненты запроса ZeoDb ZQuery.
Когда делал через RvCustomConnection писал так:
Код:
procedure TLIForm.RvLIDriversOpen(Connection: TRvCustomConnection);
begin
MainForm.DBSelect('SELECT fio,telephone,operator FROM drivers WHERE car_id='+inttostr(cars[car.ItemIndex].id),ZLIDrivers);
end;
procedure TLIForm.RvLIDriversEOF(Connection: TRvCustomConnection;
var Eof: Boolean);
begin
Eof:=ZLIDrivers.Eof;
end;
procedure TLIForm.RvLIDriversFirst(Connection: TRvCustomConnection);
begin
ZLIDrivers.First;
end;
procedure TLIForm.RvLIDriversGetCols(Connection: TRvCustomConnection);
begin
With Connection do begin
WriteField('fio',dtString,50,'fio','Фамилия имя отчество');
WriteField('telephone',dtString,30,'telephone','Телефон');
WriteField('operator',dtString,20,'phone_operator','Оператор');
end; { with }
end;
procedure TLIForm.RvLIDriversGetRow(Connection: TRvCustomConnection);
begin
With Connection do begin
WriteStrData('',ZLIDrivers.FieldByName('fio').AsString);
WriteStrData('',ZLIDrivers.FieldByName('telephone').AsString);
WriteStrData('',ZLIDrivers.FieldByName('operator').AsString);
end; { with }
end;
procedure TLIForm.RvLIDriversNext(Connection: TRvCustomConnection);
begin
ZLIDrivers.Next;
end;
procedure TLIForm.RvLIDriversRestore(Connection: TRvCustomConnection);
begin
ZLIDrivers.Active:=false;
end;
|