Board index » delphi » Indexfieldnames and SQLORA8.DLL AV

Indexfieldnames and SQLORA8.DLL AV

An access violation in SQLORA8.DLL occurs consistently when calling
TTable.Close under the following conditions:

1. The "table" specified by the TableName property is an Oracle VIEW.
2. This view returns at least one row.
3. IndexFieldNames = '' before opening the TTable.
4. IndexFieldNames is modified after opening the TTable.

Platform/driver info for which this AV has been recorded:

Oracle 8.0.3 and Oracle 8i (8.1.5) for Netware 5.
Windows NT SP4/5 on the client machine.
Oracle 8.0.3, 8.0.5, and 8.1.5 client.
BDE 5 Oracle native driver, with the following settings:
DLL32=SQLORA8.DLL
VENDOR INIT=OCI.DLL

The following steps may be taken to reproduce this error:

1. Run the following commands on the Oracle8 server:

create table table1 (a varchar2(1));
create view view1 as select * from table1;
insert into table1 values ('1');
commit;

2. Create a BDE alias "ORACLE1" using the native driver with settings as

indicated above.

3. Run the following program; log on as the user that ran the above
server commands:

program Project1;
uses DbTables;
begin
  with TTable.Create(nil) do
  begin
    DatabaseName := 'ORACLE1';
    TableName := 'VIEW1';
    Open;
    IndexFieldNames := 'A';
    Close;
  end;
end.

Tracing into the Close statement reveals that the exception is raised in

procedure TBDEDataSet.DestroyHandle, in the call to DbiRelRecordLock.

The workaround is to set IndexFieldNames to a valid value other than ''
before opening the TTable. The following is a snippet of code from the
routine in which our datasets are opened, to illustrate the workaround:

if not DataSet.Active then
begin
   if (DataSet is TTable) and (TTable(DataSet).IndexFieldNames = '')
then
      TTable(DataSet).IndexFieldNames := DataSet.Fields[0].FieldName;
   DataSet.Open;
end;

This particular implementation of the workaround obviously requires the
use of persistent fields.

Freddie Bell and Mark Jacobson (ma...@iafrica.com)

 

Re:Indexfieldnames and SQLORA8.DLL AV


Freddie,

#1 Don't use TTables, use TQuerys.
- But that may not be the problem

Check out the update for the BDE, it has some specific fixes for Oracle 8.

Good luck,
krf

Quote
freddie bell wrote in message <38D5DAEE.E4330...@iafrica.com>...
>An access violation in SQLORA8.DLL occurs consistently when calling
>TTable.Close under the following conditions:

>1. The "table" specified by the TableName property is an Oracle VIEW.
>2. This view returns at least one row.
>3. IndexFieldNames = '' before opening the TTable.
>4. IndexFieldNames is modified after opening the TTable.

>Platform/driver info for which this AV has been recorded:

>Oracle 8.0.3 and Oracle 8i (8.1.5) for Netware 5.
>Windows NT SP4/5 on the client machine.
>Oracle 8.0.3, 8.0.5, and 8.1.5 client.
>BDE 5 Oracle native driver, with the following settings:
>DLL32=SQLORA8.DLL
>VENDOR INIT=OCI.DLL

>The following steps may be taken to reproduce this error:

>1. Run the following commands on the Oracle8 server:

>create table table1 (a varchar2(1));
>create view view1 as select * from table1;
>insert into table1 values ('1');
>commit;

>2. Create a BDE alias "ORACLE1" using the native driver with settings as

>indicated above.

>3. Run the following program; log on as the user that ran the above
>server commands:

>program Project1;
>uses DbTables;
>begin
>  with TTable.Create(nil) do
>  begin
>    DatabaseName := 'ORACLE1';
>    TableName := 'VIEW1';
>    Open;
>    IndexFieldNames := 'A';
>    Close;
>  end;
>end.

>Tracing into the Close statement reveals that the exception is raised in

>procedure TBDEDataSet.DestroyHandle, in the call to DbiRelRecordLock.

>The workaround is to set IndexFieldNames to a valid value other than ''
>before opening the TTable. The following is a snippet of code from the
>routine in which our datasets are opened, to illustrate the workaround:

>if not DataSet.Active then
>begin
>   if (DataSet is TTable) and (TTable(DataSet).IndexFieldNames = '')
>then
>      TTable(DataSet).IndexFieldNames := DataSet.Fields[0].FieldName;
>   DataSet.Open;
>end;

>This particular implementation of the workaround obviously requires the
>use of persistent fields.

>Freddie Bell and Mark Jacobson (ma...@iafrica.com)

Other Threads