AV when opening a DAMemtable

any idea what could cause this AV callstack :

exception class : EAccessViolation
exception message : Access violation at address 002269C5 in module ‘Officinall.exe’. Read of address 00000002.

main thread ($1e18):
002269c5 +011 Officinall.exe System.Classes TCollection.RemoveItem
00226387 +013 Officinall.exe System.Classes TCollectionItem.SetCollection
0022625c +004 Officinall.exe System.Classes TCollectionItem.Release
00226239 +015 Officinall.exe System.Classes TCollectionItem.Destroy
002898b5 +011 Officinall.exe Data.DB TFieldDef.Destroy
000eaa60 +008 Officinall.exe System 62 +0 TObject.Free
00226618 +03c Officinall.exe System.Classes TCollection.Clear
00a1e50d +039 Officinall.exe uDADataTable 3006 +5 TDADataTable.InitializeDataTable
00a2870c +020 Officinall.exe uDADataTable 6539 +4 TDACustomDataAdapter.InitializeTable_Step1
014fc06c +220 Officinall.exe uDARemoteDataAdapter 1111 +26 TDARemoteDataAdapter.InternalFill_ReadParams
014fe393 +0e7 Officinall.exe uDARemoteDataAdapter 1657 +8 TDARemoteDataAdapter.InternalFill
01491ad4 +128 Officinall.exe uDADataAdapter 502 +6 TDABaseDataAdapter.Fill
01491965 +0b9 Officinall.exe uDADataAdapter 486 +2 TDABaseDataAdapter.Fill
00a1edf2 +0a6 Officinall.exe uDADataTable 3202 +5 TDADataTable.LoadFromRemoteSource
00a1e748 +0fc Officinall.exe uDADataTable 3051 +20 TDADataTable.DoOpen
019364b4 +024 Officinall.exe uDAMemDataTable 578 +2 TDAMemDataTable.DoOpen
02412460 +07c Officinall.exe o_OffBaseData4Objects 891 +6 TOffBaseDA4Table.DoOpen
00a1ecde +00e Officinall.exe uDADataTable 3177 +1 TDADataTable.Open

this is the caller code:

procedure TDADataTable.InitializeDataTable;
begin
fCurrRecId := 1;

try
fDataset.Fields.Clear;
fDataset.FieldDefs.Clear;

Hi,

Can you create a simple testcase that reproduces this issue, pls?
you can drop it to support@ for keeping privacy

nope sorry, this is a random thing…
and i don’t see any reason why it should occur…
it is a table that is being opened based on a windows ttimer (it’s a message notification system)
so not threaded etc etc…
so basically scenario is close and open every x seconds…

Hi,

You perform this operation in background thread (from timer).
it can be a reason for such failure if other objects like grid is linked to it.

try to play with DisableControls/EnableControls and DisableEventHandlers/EnableEventHandlers methods of table.

TTimer is running in Main thread no?

furthermore, the table isn’t used directly to display the date, after refreshing (open close) i’m duplicating the data in a memory table to display …

i’ll have a look if there is a visual hook that i’m not aware of