Hi,
I have the code below working normally on my machine, but when I load the program to the customers machine it hangs on the 255th record of the master table or sometimes it raises an index error.
The customer has 2 PCs working XP Pro, 2 notebooks, 1 vista starter, 1 xp home edition.
The master table has about 1000 records. Detail table has about 6000 records.
I couldnot understand why this is happening. Any ideas please ?
The code is;
I have the code below working normally on my machine, but when I load the program to the customers machine it hangs on the 255th record of the master table or sometimes it raises an index error.
The customer has 2 PCs working XP Pro, 2 notebooks, 1 vista starter, 1 xp home edition.
The master table has about 1000 records. Detail table has about 6000 records.
I couldnot understand why this is happening. Any ideas please ?
The code is;
Code:
hourglass_cursor(.T.) DIM tbl1 as P DIM tbl2 as P DIM tbl3 as P DIM qry1 as P DIM count_loop as N count_loop = 1 on error goto error_handler tbl1 = table.open("carikart") tbl2 = table.open("carihareket") tbl3 = table.open("yaslandirma") 'tbl = table.open(table_to_zap, FILE_RW_EXCLUSIVE) tbl3.zap(.T.) DIM top_borc as N DIM hes as C tbl1.fetch_first() while .not. tbl1.eof() hes = tbl1.Hesap_kodu top_borc = 0 hes_bak = tbl1.Borc_toplami-tbl1.Alacak_toplami query.description = "Master Detail" query.order = "Tarih" query.filter = "Hesap_Kodu = VAR->hes" query.options = "D" qry = tbl2.query_create() nrecs = qry.records_get() IF (nrecs > 0) then tbl2.fetch_first() while top_borc < hes_bak '(.not. tbl2.eof()) .and. if tbl2.Borc > 0 then tbl3.enter_begin() tbl3.Hesap_kodu = tbl2.Hesap_kodu tbl3.Tarih = tbl2.Tarih tbl3.Tip = tbl2.Tip tbl3.Aciklama = tbl2.Aciklama tbl3.Borc = tbl2.Borc tbl3.Vade = tbl2.Vade top_borc = top_borc + tbl3.Borc if top_borc > hes_bak then tbl3.Odenen = top_borc - hes_bak else tbl3.Odenen = 0 end if tbl3.enter_end(.T.) end if tbl2.fetch_next() ' tbl2 end while end if tbl1.fetch_next() count_loop = count_loop + 1 ' tbl1 end while qry.drop() query.order = "" query.filter = "" tbl3.close() tbl2.close() tbl1.close() hourglass_cursor(.F.) end error_handler: err = error_code_get() msg = error_text_get(err) ' ui_msg_box("Hata var!", msg) select case err = 800 msg = msg + "Hata kodu: 800" resume next case err = 1146 msg = msg + crlf() + "Kontrol edilemeyen bir hata oluştu..." resume next case else msg = error_text_GET(err) ui_msg_box("Bilinmeyen hata - Sıra no: " + str(count_loop), msg, UI_ATTENTION_SYMBOL) end end select ui_msg_box("Hata - Sıra no: " + str(count_loop), msg, UI_ATTENTION_SYMBOL) end
Comment