Arsip: Error : "GRID INDEX OUT OF RANGE"

more 15 years ago
flamade
Para delphiers semua,
minta tolong donk, kenapa ya setiap kali habis save data, kok selalu muncul error "grid index out of range" :( . proses save-nya sih berhasil cuma saat saya klik DBGRID (dbgrid ini terhubung ke query "isi query ada di bawah")
SQL.Text:='Select TTipe.IDTipe, TTipe.Tipe, TTipe.IDMerk, TMerk.Merk, TJenis.Jenis from TTipe, TMerk, TJenis where (TTipe.IDMerk=TMerk.IDMerk)and(TMerk.IDJenis=TJenis.IDJenis) order by Jenis';
apa ada yg salah dengan syntax di atas ? mohon koreksiannya
Thanks
-Fla-

more 15 years ago
DelphiExpert
The Delphi Bug List (Data Controls) :mrgreen: --> http://members.aye.net/~bstowers/delphi/bugs/generated/dbcontrols.htm
Problems with TDBGrid and "Grid Index Out of Range" --> http://www.elists.org/pipermail/delphi-talk/2004-March/018958.html
Yes. The nefarious "Grid Index Out of Range" has no official cause(s)
(as far as I know).
However, I've found it only happens to me when I have multiple scrolling
objects (combo/grid/etc) referencing the same TTAble/TQuery.
When I give each simultaneous scrolling object its own data access
object the problem runs to the valleys of the hinder world.
If it doesn't, try deleting all the persistent fields and rebuild them.
I hope you don't have any events on the fields. It makes the update more
painful.

more 15 years ago
DelphiExpert
tambahan buat baca2 http://translate.google.com/translate?hl=en&sl=zh-TW&u=http://delphi.ktop.com.tw/board.php%3Fcid%3D30%26fid%3D66%26tid%3D28631&sa=X&oi=translate&resnum=10&ct=result&prev=/search%3Fq%3Ddelphi%2BGRID%2BINDEX%2BOUT%2BOF%2BRANGE%26hl%3Den%26client%3Dopera%26rls%3Den%26hs%3DIdT

more 15 years ago
flamade
bro @dephiexpert, bisa tolong jelasin gak ? gak ngerti neh maksudnya gimana :
The problem is in the file Grids.pas (c:\....\Delphi 2.0\VCL\Source), line 2427. The function is TCustomGrid.MoveCurrent, and the line reads:
if (ACol < 0) or (ARow < 0) or
(ACol >= ColCount) or (ARow >= RowCount)
then
InvalidOp(SIndexOutOfRange);
dan juga ini
Instead of patching the method TCustomGrid.MoveCurrent, I patched the method TCustomDbGrid.UpdateActive (in unit DbGrids):
Instead of the line:
if Row <> NewRow then
I wrote:
if (Row <> NewRow) and (NewRow < RowCount) then
and now it works perfectly!
apakah ini harus di sisipkan di program ? cuma dibagian mana ?

more 15 years ago
DelphiExpert
anda harus membuat turunan langsung dari TCustomDBGrid... override procedure UpdateActive dan ganti/patch seperti dijelaskan diatas.
setelah membuat class turunan, misal:
type
TFlameDBGrid = class(TCustomDBGrid)
protected
procedure UpdateActive(...); override;
end;
implementation
procedure TFlameDBGrid.UpdateActive(...);
begin
// I wrote:
if (Row <> NewRow) and (NewRow < RowCount) then
...
end;
selanjutnya biar nampang di component palette anda musti install class turunan baru tersebut. caranya bisa digabungkan di packed yg telah ada (misal dclusr.dpk) atau buat paket baru, compile dan install ...
nah untuk selanjutnya gunakanlah TFlameDBGrid ini, jangan gunakan TDBGrid...
happy coding...
edited: salah method, yg benar procedure UpdateActive, sample also updated ...
more 15 years ago
flamade
@DelphiExpert: selanjutnya biar nampang di component palette anda musti install class turunan baru tersebut. caranya bisa digabungkan di packed yg telah ada (misal dclusr.dpk) atau buat paket baru, compile dan install ...woooooowww kaka delphiexpert... ane kan masih nubie.. :oops: gak ngerti maksudnya kayak gimana ? udah pake jumpalitan nih dr tadi, edit sana edit sini. tetep aja error tersebut muncul. dan yg bikin jengkel, nih proses kadang kalo lagi jalan ya jalan aja en gak ada masalah meski saya klik dbgrid-nya (error gak muncul). tapi tiba2 bisa aja tuh error muncul. duh binguuunnnn

more 15 years ago
DelphiExpert
pekerjaan anda menuntut begitu, begitulah solusi yg ditawarkan... tidak peduli anda masih newbie, kalau mau solve newbie ngga' newbie tetap harus bisa menyelesaikan... tinggal cari jalan keluarnya.
salah-satu caranya cari artikel yg berkaitan dengan cara install komponent ...
dengan keyword yg tepat anda bisa mendapatkan informasi yg dibutuhkan dalam sekejab, ini bisa jadi referensi:
- http://delphi.about.com/od/vclusing/a/customvcldev.htm
- http://delphi.about.com/od/vclusing/Understanding_Using_and_Enhancing_Delphi_Components.htm
- http://www.stevetrefethen.com/blog/HowToInstallComponentsInTheDelphiIDE.aspx
itu kalau mau cara instant & lompat-lompat... kalau mau lebih mendalami silahkan pelajari Object Oriented Programming (OOP) ...

more 15 years ago
DelphiExpert
@flamade: solusi cepat lainnya silahkan ganti menggunakan DBGrid alternative lain...
http://kylecordes.com/2001/05/01/grid-components
http://codecentral.borland.com/Item/24563
tuh banyak pilihan :lol: silahkan pilih yg paling memenuhi kebutuhan anda... entah yg freeware atau commercial ...
more ...
- Pages:
- 1
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 3 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 3 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 11 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 11 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 11 years ago
Random Topic
- SECURYTY APP
by bodoh in OOT more 14 years ago - import record dari foxpro
by idhiel in Hal umum tentang Pascal Indonesia more 11 years ago - Buat kuis pake Delphi 7
by hriy in Tip n Trik Pemrograman more 15 years ago - scan port tcp error trus
by indah_tcp in Hal umum tentang Pascal Indonesia more 18 years ago - Fingerprint
by guebego in Network, Files, I/O & System more 14 years ago - Minta Tolong Sintak SQL nya Please..
by BangJohn in MySQL more 16 years ago - Sepele tapi GAGAL!!
by fcomputer in Bedah Kasus more 14 years ago - Modular Programming di Delphi
by bagussb in Tip n Trik Pemrograman more 16 years ago - Menentukan lama pinjam & diskon program rental
by ho2sly in Tip n Trik Pemrograman more 15 years ago - SMS ShoutBox, layakkah?
by LuriDarmawan in Kritik & Saran more 17 years ago