Arsip: Error : "GRID INDEX OUT OF RANGE"

 
user image
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-
user image
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.
user image
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
user image
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 ?
user image
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 ...
user image
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
user image
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) ...
user image
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
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com