Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to retrieve FOREIGN key information from an ORACLE database using Visual Basic (and preferably ADO/ADOX)

Re: How to retrieve FOREIGN key information from an ORACLE database using Visual Basic (and preferably ADO/ADOX)

From: Leon <leonmi_at_hotmail.com>
Date: Thu, 27 Jan 2000 15:19:20 GMT
Message-ID: <YlZj4.527$Sa2.20449@newsread2.prod.itd.earthlink.net>


Try using Oracle OLEDB provider instead of ODBC (make sure you're not using DSN - this will force an ODBC)...
Also, check if Oracle has a newer OLEDB provider available.

Shared PC <Internet_at_centbldg.demon.co.uk> wrote in message news:948976460.19446.0.nnrp-03.c2de9529_at_news.demon.co.uk...
> Can anyone please give me some guidance as to a way in which it is
possible
> to read from an ORACLE database the foreign keys.
>
> If it is not possible via ADO or ADOX to retrieve this information does
> anyone know of any other way to determine this information - as I am
hoping
> to read a database structure properly without any hard coding of
structures.
>
> The ODBC oracle driver being used to execute the code below is the
Microsoft
> one that is supplied with Visual Basic 6 SP3. The line of code that
raises
> an 'Unsupported function with driver' message in Oracle is highlighted
with
> **:
>
> Dim ky As New ADOX.Key
> Dim cat As New ADOX.Catalog
> Dim cnn As New ADODB.Connection
> Dim tbl As New ADOX.Table
>
> 'Oracle Connection String follows
> cnn.Provider = "MSDAORA.1"
> cnn.Open "Data Source=mydsn;User Id=myid;Password=mypwd;"
> Set cat.ActiveConnection = cnn
>
> For Each tbl In cat.Tables
> Debug.Print "Looping through each table entry"
>
> If tbl.Type = "TABLE" Then
> Debug.Print "Found a user table"
>
> ** For Each ky In tbl.Keys
> ** Debug.Print "Looping through each of the keys"
> ** Next ky
> End If
> Next tbl
>
>
> If instead of the above provider and open connection lines the following
are
> used to connect
> to an ACCESS database the above code functions correctly:
> cnn.Provider = "Microsoft.Jet.OLEDB.4.0"
> cnn.Open "Data Source=c:\northwind.mdb"
>
> Anyone have any ideas?
>
>
>
Received on Thu Jan 27 2000 - 09:19:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US