Page 1 of 1

Acces Violation

Posted: Fri 05 May 2006 11:11
by Milan Bacik
I get acces violation using ODAC TOraTable.

struct InfoForCombo
{
AnsiString ValueHodn;
AnsiString ListHodn;
};
....

void __fastcall TFilterCombo::NastavTTable(TDataSet *poiTTable)
{
...
PoleInfoCombo = new InfoForCombo[iRozsah];
while (!pTTable->Eof)
{
PoleInfoCombo.ValueHodn = pFieldVal->AsString; AsString;
Items->Add(PoleInfoCombo.ListHodn);
pTTable->Next();
i += 1;
}

}

Function is called with pointer to TOraTable. It has worked perfectly with BDE TTable for years. Error ocure only sometime.

CallStack:
:7c81eb33 kernel32.RaiseException + 0x52
:51f06a48 rtl100.@System@@BeforeDestruction$qqrp14System@TObjectzc + 0x48
:7c90378b ntdll.RtlConvertUlongToLargeInteger + 0x46
:7c90eafa ntdll.KiUserExceptionDispatcher + 0xe
:003A5E5D TFilterCombo::NastavTTable(this=:02AF3EA0, poiTTable=????)

In Assembly:
003A5E58 E843260000 call System::AnsiString::operator =(const System::AnsiString &)
003A5E5D FF4DD0 dec dword ptr [ebp-$30]

Using ODAC Trial Version, BDS 2006 Architekt Update 1, WinXP SP2.

I forgott copy part of code

Posted: Fri 05 May 2006 11:15
by Milan Bacik
void __fastcall TFilterCombo::NastavTTable(TDataSet *poiTTable)
{
...
PoleInfoCombo = new InfoForCombo[iRozsah];
TField *const pFieldVal = poiTTable->FieldByName(pValField);
TField *const pFieldList = poiTTable->FieldByName(pListField);
while (!pTTable->Eof)
{
PoleInfoCombo.ValueHodn = pFieldVal->AsString; AsString;
Items->Add(PoleInfoCombo.ListHodn);
pTTable->Next();
i += 1;
}

}

Posted: Fri 05 May 2006 14:00
by Challenger
We couldn't reproduce this error using information you have specified. Please send to ODAC support address complete sample that demonstrates this problem and include script to create server objects.

Problem solved

Posted: Fri 12 May 2006 07:35
by Milan Bacik
Problem wasn't in ODAC component. Alocation of PoleInfoCombo = new InfoForCombo[iRozsah]; was based on RecordCount. But RecordCount returned only 25 because FaetchAll was false.