Arsip: [HELP] SORTING DBGRID-INTERBASE

more 10 years ago
vahnkrist
Permisi mau bertanya
melakukan sorting records DBGrid dengan clicking di column title,
tapi menggunakan Interbase set database.
ada yang tahu?
thanks for ur answer.... :)

more 10 years ago
halimanh
Ini adalah tutorial sorting dbgrid pake ado, kalo pake interbase tinggal disesuaikan. http://delphi.about.com/od/usedbvcl/l/aa042203a.htm

more 10 years ago
vahnkrist
disesuaikannya gimana? di tuker IBdataset(IBQuery,IBtable) ADODatasetnya ??? sorry nda mudeng...masih newbie :)

more 10 years ago
halimanh
iya. Dan kalo propery/methodnya beda tinggal disesuaikan. saya nggak pake interbase, dan nggak install interbase servernya, jadi nggak bisa liat.

more 10 years ago
kyk ga kenal identifier "Sort".... :(
kumaha iyeuh ey...owalah.
sy pake Delphi 7 + Interbase 6.5
(komponen DBnya IBdatabase, IBTransaction, IBquery, DataSource)<<< dalam form data module bukan frm barang
cuman tggal sortir doang.....meni hese ey diteang2 te :( [/code]
vahnkrist


more 10 years ago
halimanh
Kalo nggak ada sortnya, yah nggak bisa pake itu. Ada lagi post disini http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_11771698.html

more 10 years ago
halimanh
Dari expert exchange
Ok, I did some testing. If you have some higher versions of Delphi, you can use TClientDataSet.
Below is my test case:
1. Drop TIBDatabase, TIBTransaction, TIBDataSet, TClientDataSet, TDataSource, and TDBGrid on a form.
2. Set TIBDatabase, and TIBTransaction properties so that you can connect the database.
3. Set TIBDataSet's SelectSQL property to get your data.
4. Right click ClientDataSet1 and select Assign Local data from the menu. Select IBDataSet1 from the list. (There shouldn't be more, anyway :-)).
5. Eventually, specify FileName for the local file.
6. In my case, things were somewhat slow, but see my notes below.
7. Assign DataSource1's Dataset to ClientDataSet1 and finally, set DBGrid's DataSource to ClientDataSet1.
8. Write an event handler to DBGrid1's OnTitleClick event:
procedure TForm1.DBGrid1TitleClick(Column: TColumn);
begin
ClientDataSet1.IndexFieldNames := Column.Title.Caption;
end;
That's all. Tested on some 40,000 records table (The table had 20 Columns, mostly numeric (double precision)). The response time was good (always less than 1 sec, obviously 200-300 msec). Tested with IB 6, D 5 Ent,
Pentium II 300 MHz / 128 MB.

more 10 years ago
hendrang67
@vahnkrist:Untuk sort kalau pakai IBTable, isi indexfieldnames nya sesuai dgn field yg akan disort, kalau kalau pakai IBQuery lakukan query ulang. Contoh : Pakai TIBTable procedure TForm1.DBGrid1TitleClick(Column: TColumn); begin IBTable1.IndexFieldNames:= Column.FieldName; //IBTable1.IndexName:= Column.FieldName; // Kalau code di atas tdk bisa, coba aktifkan code ini end; Pakai TIBQuery procedure TForm1.DBGrid1TitleClick(Column: TColumn); var FldName: String; begin FldName:= Column.FieldName; IBQuery1.Close; IBQuery1.SQL.Text:= 'Select * from noperk order by '+ fldName; IBQuery1.ExecSql; end; Saya juga tidak pakai Interbase jadi tdk bisa test.kyk ga kenal identifier "Sort".... :( kumaha iyeuh ey...owalah. sy pake Delphi 7 + Interbase 6.5 (komponen DBnya IBdatabase, IBTransaction, IBquery, DataSource)<<< dalam form data module bukan frm barang cuman tggal sortir doang.....meni hese ey diteang2 te :( [/code]

more 10 years ago
hendrang67
@hendrang67: [quote:6d6bdc2cc3="vahnkrist"]Pakai TIBQuery procedure TForm1.DBGrid1TitleClick(Column: TColumn); var FldName: String; begin FldName:= Column.FieldName; IBQuery1.Close; IBQuery1.SQL.Text:= 'Select from <nama file> order by '+ fldName; IBQuery1.ExecSql; end;kyk ga kenal identifier "Sort".... :( kumaha iyeuh ey...owalah. sy pake Delphi 7 + Interbase 6.5 (komponen DBnya IBdatabase, IBTransaction, IBquery, DataSource)<<< dalam form data module bukan frm barang cuman tggal sortir doang.....meni hese ey diteang2 te :( [/code][/quote:6d6bdc2cc3] Untuk sort kalau pakai IBTable, isi indexfieldnames nya sesuai dgn field yg akan disort, kalau kalau pakai IBQuery lakukan query ulang. Contoh : Pakai TIBTable procedure TForm1.DBGrid1TitleClick(Column: TColumn); begin IBTable1.IndexFieldNames:= Column.FieldName; //IBTable1.IndexName:= Column.FieldName; // Kalau code di atas tdk bisa, coba aktifkan code ini end; Pakai TIBQuery procedure TForm1.DBGrid1TitleClick(Column: TColumn); var FldName: String; begin FldName:= Column.FieldName; IBQuery1.Close; IBQuery1.SQL.Text:= 'Select from noperk order by '+ fldName; IBQuery1.ExecSql; end; Saya juga tidak pakai Interbase jadi tdk bisa test.
more ...
- Pages:
- 1
- 2
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 2 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 3 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 10 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 10 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 10 years ago
Random Topic
- ToOl Is3ng BuaT mIndahIn dAta
by cyber_hecker in MsSQL more 16 years ago - TDBlookupcombobox
by amakita in Hal umum tentang Pascal Indonesia more 15 years ago - How to make appearance smootly?
by johnizzy in Form Enhancement & Graphical Controls more 14 years ago - Knapa bisa error yah help pls :(
by stoopid in Network, Files, I/O & System more 16 years ago - buat kamus???
by drfa20 in Bedah Kasus more 15 years ago - ShellExecute vs WinExec!!!!
by diqshu in Tip n Trik Pemrograman more 16 years ago - Buat class di Delphi untuk sebagai manager
by hendra_sir84 in Hal umum tentang Pascal Indonesia more 15 years ago - Borland Delphi 7 in Windows Vista
by BorlandMania in Hal umum tentang Pascal Indonesia more 15 years ago - aplikasi command prompt
by ard33 in Tip n Trik Pemrograman more 14 years ago - mau tanya cara copy table..???
by agoes in Hal umum tentang Pascal Indonesia more 15 years ago