Henning Sommerkamp
12/2/2002 1:37:00 PM
Hi Richard,
Richard wrote:
> Dear All,
>
> I have started using ODBC for .NET and I use the registry to enumerate
> the DSN names on a local machine then when a user has selected the DSN
> name I want to be able to list the Datatables available through that DSN.
>
> I have seen some examples but none work with ODBC connections they all
> use OLEDB schema requests. Can anyone help?
On 15.10.2002 21:09 Hussein Abuthuraya of Microsoft Developer Support
stated in this group that the .net ODBC Driver is not capable of
performing that task at all.
I guess you have to switch back to VB6 or so since you have more
features there than in .net.
What I found out anyway is, that you can use ADODB to connect so ODBC
sources. In VB.net it works this way:
Dim con As New ADODB.ConnectionClass()
con.Open("my-dsn-name", "certiuser", "certiuser")
Dim rsTabs As ADODB.Recordset
Dim rsCols As ADODB.Recordset
rsTabs = con.OpenSchema(ADODB.SchemaEnum.adSchemaTables)
rsCols = con.OpenSchema(ADODB.SchemaEnum.adSchemaColumns)
...now I can get all schemas from the recordsets.
Anyway, this did not work with mysql sources, but with sapdb it was just
fine.
cheers,
Henning