CRThread Wrapper access violation.

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 101
Joined: Tue 01 May 2007 16:36

CRThread Wrapper access violation.

Post by ccmcbride » Tue 22 Jul 2008 00:01

I have a table open routine, and a show error routine.
Currently, I have a master/detail set of table, and I am trying to open the detail table, which has 246 records, with 32 fields.
I am getting the dreaded 'row handles must be released error', and can't get rid of it.

I am trapping the error, and sending it to my showerror routine, which is showing THAT error, but on top of that is this one:
Why am I getting an access violation in crThreadTimer, and how can I trap/ignore that one?
It's happening in this line of code:
function ShowError(aState : integer;DataSet: TDataSet; E: EDatabaseError) : tDataAction;
aStr : string;
aTable : string;
mResult : tModalResult;
aMessage : string;
result := daAbort;
if aState = 1 then
aStr := 'delete'
if aState = 3 then
aStr := 'post'
if aState = 4 then
aStr := ' opening'
aStr := 'edit';
aTable := tmsTable(DataSet).TableName;
aMessage := e.Message;
if (E is EDatabaseError) then
mResult := MessageDlg('Error on ' + aTable + ': ' + aMessage, mtWarning, [mbAbort, mbRetry, mbCancel], 0);----------> blow up on top of message dialog box

Exception 'Exception' in module SME5.exe at 0021552B
Access violation at address 0062D405 in module 'SME5.exe'. Read of address 00000000

Module: CRThread, Source: UNKNOWN, Line UNKNOWN
Procedure: Crthread::TCRThreadWrapper::DoTimer

Call stack:
:0061652B [SME5.exe] Crthread::TCRThreadWrapper::DoTimer
:7C812AEB [kernel32.dll]
:0061652B [SME5.exe] Crthread::TCRThreadWrapper::DoTimer
:7E43E1AD [user32.dll]
Recursive call (2 times):
:0061652B [SME5.exe] Crthread::TCRThreadWrapper::DoTimer
:00616593 [SME5.exe] Crthread::TCRThreadWrapper::DoTimer
:00616605 [SME5.exe] Crthread::TCRThreadWrapper::DoTimer
:00615F16 [SME5.exe] Crthread::TimerCallBack
:7E418734 [user32.dll]
:7E419857 [user32.dll]
:7E419791 [user32.dll]
:7E4196C7 [user32.dll]
:004C9978 [SME5.exe] Forms::TApplication::ProcessMessage
:004C99AF [SME5.exe] Forms::TApplication::HandleMessage
:004C64D6 [SME5.exe] Forms::TCustomForm::ShowModal
:004C655C [SME5.exe] Forms::TCustomForm::ShowModal
:004C65FD [SME5.exe] Forms::TCustomForm::ShowModal
:004C661F [SME5.exe] Forms::TCustomForm::ShowModal
:004C663C [SME5.exe] Forms::TCustomForm::ShowModal
:004ABBEB [SME5.exe] Controls::TWinControl::RecreateWnd
:00454CDA [SME5.exe] Dialogs::MessageDlgPosHelp
:00454CF3 [SME5.exe] Dialogs::MessageDlgPosHelp
:00454C2B [SME5.exe] Dialogs::MessageDlg
:011067A9 [SME5.exe] Globals::ShowError (globals.pas, line 3255)
:0110682E [SME5.exe] Globals::ShowError (globals.pas, line 3278)
:010FCA9F [SME5.exe] Globals::TableOpen (globals.pas, line 825)
:0061BF7C [SME5.exe] Oledbaccess::TOLEDBConnection::OLEDBError
:7C9032A8 [ntdll.dll]

Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 22 Jul 2008 07:23

I cannot reproduce the problem. Could you send us a complete small sample at sdac*devart*com including script to create server objects? Also specify the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.

Posts: 101
Joined: Tue 01 May 2007 16:36

Post by ccmcbride » Tue 22 Jul 2008 16:28

I 'fixed' it by replacing the table with a query, same number of records, same master, 25 fields in the query, and the row handles error is gone.
Not sure I understand why the query works and not the table, when the difference is a few fields.

I will see if I can put together a sample, but my code is using a devexpress grid to display the data.

Using Delphi7,
Microsoft SQL Server: 09.00.3068
Microsoft SQL Native Client: 9.00.3042.00

Post Reply