Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: linenumber on error ?
linenumber on error ?
Posted: 2007/09/06 08:55
 
Hi !

Im using an ADQuery where i would like to find out at EDatabaseError wich line in the SQL-string the error accured ?

CODE ATM:

try
ADQuery.SQL.Text := queryWideString;
ADQuery.ExecSQL; // Run Query !
// EXCEPTION ERROR
except on E: EDatabaseError do begin
showmessage(e.Message); // I also would like to see on wich line =/
...
end;

// Zyddee
Re:linenumber on error ?
Posted: 2007/09/06 09:10
 
Hello

Tha depends on DBMS. Not all DBMS's are providing the error position in SQL text. But you can always check EADDBEngineException(E)[0].CommandTextOffset. If it is >= 0, then it contains some meaningful info.

Regards,
Dmitry
Re:linenumber on error ?
Posted: 2007/09/06 10:04
 
Im not sure what mean by DBMS, but im using MsSQL2000.

unfortunately i cant find EADDBEngineException, just these:

EADDAptRowUpdateException
EADPhysArrayExecuteError
EADOError

Are these to any help for me or are there any solution for me to call EADDBEngineException?

im kinda new to this level of database programming, but I appreciate all help that gets me any step close to solve my problem, thx Diman

// zyddee
Re:linenumber on error ?
Posted: 2007/09/10 05:08
 
sorry for my bad english, but i still need help whit this problem..hm
Re:linenumber on error ?
Posted: 2007/09/10 07:33
 
Hello

V 1.x does not return line number for MSSQL errors.
V 2.x will do that, but with some limitaitons.

Regards,
Dmitry