Re: [Lazarus] SQLDB invalid handle

2009-03-15 Thread Bram Kuijvenhoven
Stephano wrote:
 Bram Kuijvenhoven wrote:
 Could you please provide some more details?
 - FPC version
 - A minimal but complete test program demonstrating the error
  
 It would also be great if you had a stack trace (see 
 http://wiki.freepascal.org/Creating_a_Backtrace_with_GDB).

 FPC 2.2.2
 Lazarus v0.9.27 r18956 i386-win32-win32/win64
 Win XP
 Sybase 6
 Test project attached

Thank you. I don't have a Sybase server or even a Sybase ODBC driver here, but 
after modifying your code to connect to a MySQL server that I have running, I 
also got an exception (an Access Violation actually).

However, when I use the SQLDB and ODBConn units from FPCs trunk (rev. 12825), 
the program no longer crashes. Since some changes were made between 2.2.2 and 
trunk in the code that allocates and deallocates statement handles, the crash 
may have been fixed.

Could you please test with FPCs trunk? (shortcut: copy the .inc/.pp/.pas files 
to your test program's directory from trunk/packages/fcl-db/src/, subdirs base, 
dbase, sqldb and sqldb/odbc)

BTW your test program depends on the LCL, but this is not necessary; you may 
find it easier to test with a command line program.

Regards,

Bram
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SQLDB invalid handle

2009-03-13 Thread Bram Kuijvenhoven
Dear Stephano,

Stephano wrote:
 The following code produces an error:

Could you please provide some more details?
- FPC version
- A minimal but complete test program demonstrating the error

To ensure reproducibility of the problem, please report under which 
configuration of OS, DBMS and ODBC driver your minimal test program showed the 
problem.

It would also be great if you had a stack trace (see 
http://wiki.freepascal.org/Creating_a_Backtrace_with_GDB).

 error is: could not prepare statement
 Last return code: SQL_INVALID_HANDLE
 Invalid handle passed to SQLGetDiagRec/Field

So far I can see that the call to SQLPrepare failed (in 
TODBCConnection.PrepareStatement), but that unfortunately the ODBC error 
message could not be retrieved.

Regards,

Bram Kuijvenhoven
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus