Retrieve Table's Primary Key via OLE DB

Hi!

I’m accessing an Oracle database via Oracle Provider for OLE DB 11g Release 1 (11.1.0.7.20) using Delphi (several versions).

The program works as expected, opening tables and displaying information. But I’m unable to retrieve metadata information (basically Primary Key) from tables.

If the connection string is changed to a MS SQL Server, everything works fine, so I assume is a nuance of Oracle provider.

The actual connection string is:

Provider=OraOLEDB.Oracle.1;Password=****;Persist Security Info=True;User ID=myID;Data Source='(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = myIP)(PORT = 1522))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE)))'

The metadata is retrieved examined the recordset field properties. BASECOLUMNNAME and BASETABLENAME are the only properties with valid values, all other, inclusive KEYCOLUMN and ISAUTOINCREMENT returns 0 for every column.

Field’s attributes (like adFldKeyColumn = $00008000) are not useful neither, although adFldFixed or adFldIsNullable returns valid information.

As far as I understand the "Oracle® Provider for OLE DB Developer's Guide", in section "MetaData Columns Supported" states that these properties are supported.

Any help to correctly get the columns properties via ADO would be much appreciated.

Thanks in advance,

Homo Programmatoris

0 answers