Bug #8389 Ado-Interface with Option adSchemaForeignKeys does not Work
Submitted: 9 Feb 2005 10:22 Modified: 11 Jan 2008 19:49
Reporter: Hans Simon Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.11 OS:Windows (Win2000)
Assigned to: Jim Winstead CPU Architecture:Any
Tags: ODBC5-RC

[9 Feb 2005 10:22] Hans Simon
Description:
Ado-Inteface OpenSchema does not work with Option adSchemaForeignKeys.
The following fields are supplyed wrong:

FK_NAME  -> ist not supllyed
UPDATE_RULE -> is supplyed wrong
DELTE_RULE -> is supplyed wrong
PK_TABLE_NAME -> is supplyed with quotationmarks
FK_TABLE_NAME -> is supplyed with quotationmarks
PK_COLUMN_NAME -> is supplyed with quotationmarks
FK_COLUMN_NAME -> is supplyed with quotationmarks

DataDefinition can not be read by ADO-Connectors. What means: Using mySQL on Visual Basic 6.0 with Ado is impossible! Is there another way? Or can we forget mySQL?

How to repeat:
Dim cn As New ADODB.Connection
Dim Rs As ADODB.RecordSet

cn.Open("DSN=mySQL")  

Set Rs = cn.OpenSchema(adSchemaForeignKeys)

Debug.Print Rs!FK_NAME; Rs!UPDATE_RULE ' etc.

Suggested fix:
A working ADO-Inteface.
[9 Feb 2005 12:42] Harun Eren
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[11 Jan 2008 19:49] Jim Winstead
OpenSchema(adSchemaForeignKeys, Array(Empty, Empty, "ParentTable")) works fine with Connector/ODBC 5.1.2 (to be released soon). It appears that ADO has a bug in that it tries to specify a wildcard for the table name when no constraints are specified, but this is not allowed according to the specification for the underlying SQLForeignKeys() method.