Acces Violation

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Milan Bacik
Posts: 28
Joined: Fri 28 Apr 2006 08:59
Location: Czech Republic
Contact:

Acces Violation

Post by Milan Bacik » Fri 05 May 2006 11:11

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.

Milan Bacik
Posts: 28
Joined: Fri 28 Apr 2006 08:59
Location: Czech Republic
Contact:

I forgott copy part of code

Post by Milan Bacik » Fri 05 May 2006 11:15

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;
}

}

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 05 May 2006 14:00

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.

Milan Bacik
Posts: 28
Joined: Fri 28 Apr 2006 08:59
Location: Czech Republic
Contact:

Problem solved

Post by Milan Bacik » Fri 12 May 2006 07:35

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.

Post Reply