Lars Hammer
Member²
I made a combobox component, that uses a TOracleQuery to get its data from the database.
When the query is performed I get an access violation (write of some address). The access violation arrives, when I call FQuery->Field(). The other functions are working correctly. See the code sample below.
Is there any explanation on why this happens?
FQuery->Execute();
while (!FQuery->Eof)
{
try
{
int FieldNum = FQuery->FieldIndex(FDisplayField);
int FieldCount = FQuery->FieldCount();
int FieldSize = FQuery->FieldSize(FieldNum);
// The following gives an access violation.
Variant V = FQuery->Field(FieldNum);
AnsiString DispFld = V;
FQuery->Next();
}
When the query is performed I get an access violation (write of some address). The access violation arrives, when I call FQuery->Field(). The other functions are working correctly. See the code sample below.
Is there any explanation on why this happens?
FQuery->Execute();
while (!FQuery->Eof)
{
try
{
int FieldNum = FQuery->FieldIndex(FDisplayField);
int FieldCount = FQuery->FieldCount();
int FieldSize = FQuery->FieldSize(FieldNum);
// The following gives an access violation.
Variant V = FQuery->Field(FieldNum);
AnsiString DispFld = V;
FQuery->Next();
}