home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 March
/
Chip_2002-03_cd1.bin
/
zkuste
/
delphi
/
kompon
/
d5
/
CSDBPACK.ZIP
/
sample
/
testbrowse.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-12-21
|
2KB
|
67 lines
unit testbrowse;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
CSDBBrowse, StdCtrls, Db, ADODB, DBTables;
type
TForm1 = class(TForm)
CSDBBrowse1: TCSDBBrowse;
DataSource1: TDataSource;
Button1: TButton;
Query1: TQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
with CSDBBrowse1.Param do begin
Clear;
TableName:='customer';
Key.Add('CustNo');
MultipleSelect:=True;
// change first column title for first displaystr
TitleStr.Add('Customer No|Company Name|Address1|Address2');
// note that the line below is not mandatory, try remove the comments
// and see the difference by selecting the second display
// TitleStr.Add('Customer No|Country|City|State|Last Invoice Date');
IndexName.Add('Customer No');
IndexName.Add('Country, City, State');
IndexName.Add('Last Invoice Date');
IndexStr.Add('custno');
IndexStr.Add('country, city, state');
IndexStr.Add('lastinvoicedate');
DisplayName.Add('Default long display'); // show all fields
DisplayName.Add('Short display'); // show only few fields
DisplayStr.Add('*'); // show all fields
DisplayStr.Add('custno, country, city, state, lastinvoicedate'); // show only few fields
CSDBBrowse1.Execute;
for i:=0 to ResultStr.Count-1 do
ShowMessage('Selected customer no:' + ResultStr.Strings[i]);
end;
end;
end.