Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Connection lost to database" in DBGrid scrolling ...

Status
Not open for further replies.

TheMisiacz

Programmer
Nov 25, 2003
2
0
0
PL
I am using Delphi5 and Interbase 6.x with IBX 4.52 (higher number has the same problem).

The problem is while i am scrolling TDBGrid, then server is shuting down and restart, it seems like something with select query problem ... this select looks like this one:

SELECT P1.PU_IDPOZPRZ, CAST(P1.PU_DATADOST AS DATE) AS DATADOST, CAST(P1.PU_DATADOST AS TIME)
AS GODZDOST, P1.PU_NETTO, P1.PU_BRUTTO, P1.PU_TARA, P1.PU_METODA, O1.OD_KOD, FrmKod(O1.OD_KOD) FrmKod, R1.*, K1.*, J1.* FROM REJESTR_PRZYWOZU R1, POZYCJA_PRZYWOZU P1, KONTRAHENT K1, POJAZD J1, ODPAD O1
WHERE RP_DOSTAWCA = KO_IDKONTRAHENT
AND RP_POJAZD = PD_IDPOJAZD
AND P1.PU_ODPAD=O1.OD_IDODPAD
AND PU_REJPRZ=RP_IDREJPRZ
AND PU_DATADOST=(SELECT MIN(PU_DATADOST) FROM POZYCJA_PRZYWOZU WHERE PU_REJPRZ=R1.RP_IDREJPRZ)
AND PU_POZPRZ IS NULL

No matter what it makes, but it operates on table with 5000 records now ... sometimes other error happens, "internal gds ... cannot start thread", or something like "... insufficient memory ...".

Please help, any suggestions?
 
What is " FrmKod " ?

Also, try using the JOIN syntax instead of table1, table2, table3 ...



Martijn Tonies
Database Workbench - the developer tool for InterBase, Firebird and MS SQL Server
 
You are right, i found problem yetserday with external function frmkod, exactly with types of parameters used in Delphi and Interbase. Interbase documentation says that for parameters which have memory allocation inside dll, you should use CSTRING type in interbase in DECLARE EXTERNAL FUNCTION statement. And this is the problem, this CSTRING doesnt work properly with PCHAR in Delphi ... I changed it in interbase to CHAR, and works much more better, but not to the end ... still connection lost but from time to time, not each time ... still problem, but smaller, now i will try to recode dll function ...
 
Try download "FreeUDFLib" (google for it) - it has some examples on how to handle strings.


Martijn Tonies
Database Workbench - the developer tool for InterBase, Firebird, MySQL & MS SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top