[Lazarus] SQLDB invalid handle

Stephano patspiper at yahoo.com
Sat Mar 14 14:07:50 CET 2009


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

> 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.
Very possible as even a prepare instead of the 2nd open would give the 
same error

Backtrace:
#0  0x0040ad46 in fpc_raiseexception ()
#1  0x0054cfce in 
ODBCCONN_ODBCCHECKRESULT$crc8B09F779_CHECKSQLGETDIAGRESULT$SMALLINT ()
#2  0x0007f1d0 in ?? ()
#3  0x0054cd42 in 
ODBCCONN_ODBCCHECKRESULT$SMALLINT$SMALLINT$POINTER$ANSISTRING$
array_of_const ()
#4  0x0054d06f in 
ODBCCONN_ODBCCHECKRESULT$SMALLINT$SMALLINT$POINTER$ANSISTRING
     ()
#5  0x0054dd38 in 
ODBCCONN_TODBCCONNECTION_$__PREPARESTATEMENT$TSQLCURSOR$TSQLTR
ANSACTION$ANSISTRING$TPARAMS ()
#6  0x00549911 in SQLDB_TCUSTOMSQLQUERY_$__PREPARE ()
#7  0x0054a23d in SQLDB_TCUSTOMSQLQUERY_$__INTERNALOPEN ()
#8  0x00551340 in DB_TDATASET_$__DOINTERNALOPEN ()
#9  0x000f6de8 in ?? ()
#10 0x00551e9a in DB_TDATASET_$__OPENCURSOR$BOOLEAN ()
#11 0x000f6d01 in ?? ()
#12 0x00552196 in DB_TDATASET_$__SETACTIVE$BOOLEAN ()
#13 0x00549683 in SQLDB_TCUSTOMSQLQUERY_$__SETACTIVE$BOOLEAN ()
#14 0x000f6de8 in ?? ()
#15 0x00623958 in $STDCTRLS$_Ld71 ()
#16 0x0041ebb6 in TFORM1__BUTTON1CLICK (SENDER=0x1b09518, this=0x1b090c8)
     at unit1.pas:42
#17 0x0048dcc4 in TCONTROL__CLICK (this=0x1b09518) at control.inc:2108
#18 0x0049e75f in TBUTTONCONTROL__CLICK (this=0x1b09518)
     at buttoncontrol.inc:63
#19 0x0049ec25 in TCUSTOMBUTTON__CLICK (this=0x1b09518) at buttons.inc:164
#20 0x0049f151 in TBUTTON__CLICK (this=0x1b09518) at buttons.inc:320
#21 0x0049e62a in TBUTTONCONTROL__WMDEFAULTCLICKED (MESSAGE=
       {MSG = 66567, WPARAM = 5209264, LPARAM = -591746099, RESULT = 0, 
WPARAMLO
= 31920, WPARAMHI = 79, LPARAMLO = 43981, LPARAMHI = 56506, RESULTLO = 
0, RESULT
HI = 0}, this=0x1b09518) at buttoncontrol.inc:26
#22 0x0040a699 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#23 0x0049e610 in TBUTTONCONTROL__ISCHECKEDSTORED (this=0x7f758)
     at buttoncontrol.inc:22
#24 0x00484bc4 in TWINCONTROL__WNDPROC (MESSAGE=
       {MSG = 66567, WPARAM = 5209264, LPARAM = -591746099, RESULT = 0, 
WPARAMLO
= 31920, WPARAMHI = 79, LPARAMLO = 43981, LPARAMHI = 56506, RESULTLO = 
0, RESULT
HI = 0}, this=0x1b09518) at wincontrol.inc:4804
#25 0x00514ba7 in DELIVERMESSAGE (TARGET=0x1b09518, AMESSAGE=void)
     at lclmessageglue.pas:111
#26 0x004f9f8d in WINDOWPROC (WINDOW=1902210, MSG=273, WPARAM=38168,
     LPARAM=656932) at win32callback.inc:2443
#27 0x77d48709 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
#28 0x001d0682 in ?? ()
#29 0x00000111 in ?? ()
#30 0x00009518 in ?? ()
#31 0x000a0624 in ?? ()
#32 0x004f7cb0 in GETNEEDPARENTPAINT (AWINDOWINFO=0x4f7cb0,
     AWINCONTROL=0x7f7d4) at win32callback.inc:205
#33 0x77d487eb in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
#34 0x004f7cb0 in GETNEEDPARENTPAINT (AWINDOWINFO=0x0, 
AWINCONTROL=0x77d48808)
     at win32callback.inc:205
#35 0x77d4b743 in USER32!GetParent () from C:\WINDOWS\system32\user32.dll
#36 0x00000000 in ?? () from
#37 0x004f7cb0 in GETNEEDPARENTPAINT (AWINDOWINFO=0x7f830,
     AWINCONTROL=0x1d0682) at win32callback.inc:205
#38 0x77d4b7ab in USER32!SendMessageW () from C:\WINDOWS\system32\user32.dll
#39 0x007d8890 in ?? ()
#40 0x017d7bd0 in ?? ()
#41 0x00009518 in ?? ()
#42 0x000a0624 in ?? ()
#43 0x00000000 in ?? () from
#44 0x00150808 in ?? ()
#45 0x0007f87c in ?? ()
#46 0x773f6ff6 in ImageList_Duplicate ()
    from 
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df
_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
#47 0x001d0682 in ?? ()
#48 0x00000111 in ?? ()
#49 0x00009518 in ?? ()
#50 0x000a0624 in ?? ()
#51 0x00000001 in ?? ()
#52 0x00150808 in ?? ()
#53 0x0007f898 in ?? ()
#54 0x773f70d8 in ImageList_Duplicate ()
    from 
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df
_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
#55 0x00150808 in ?? ()
#56 0x00000000 in ?? () from
#57 0x000a0028 in ?? ()
#58 0x00150808 in ?? ()
#59 0x00000001 in ?? ()
#60 0x0007f928 in ?? ()
#61 0x773f93dd in ImageList_Duplicate ()
    from 
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df
_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
#62 0x00150808 in ?? ()
#63 0x00000001 in ?? ()
#64 0x0007f990 in ?? ()
#65 0x773f8b56 in ImageList_Duplicate ()
    from 
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df
_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
#62 0x00150808 in ?? ()
#63 0x00000001 in ?? ()
#64 0x0007f990 in ?? ()
#65 0x773f8b56 in ImageList_Duplicate ()
    from 
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df
_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
---Type <return> to continue, or q <return> to quit---
#66 0x00000000 in ?? () from
#67 0x0007f88c in ?? ()
#68 0x0007f8ec in ?? ()
#69 0x00000001 in ?? ()
#70 0x00000012 in ?? ()
#71 0x0007f8d4 in ?? ()
#72 0x00000000 in ?? () from
#73 0x00000000 in ?? () from
#74 0x00000012 in ?? ()
#75 0x000a0028 in ?? ()
#76 0x000a0624 in ?? ()
#77 0x00000000 in ?? () from
#78 0x00000000 in ?? () from
#79 0x0007f87c in ?? ()
#80 0x004fbb7a in SENDPAINTMESSAGE (CONTROLDC=1378312, parentfp=0x0)
     at win32callback.inc:371
Previous frame inner to this frame (corrupt stack?)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ODBCopen.zip
Type: application/x-zip-compressed
Size: 3000 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20090314/d3b5755f/attachment-0007.bin>


More information about the Lazarus mailing list