Photog
2006-07-06 14:46:54 UTC
I'm using ADO (through the ADODB interop assembly) from inside a C# .NET
application.
I'm trying to use ADODB.Connection.OpenSchema to return table and column
info from an MS Access database.
Here's the call:
rs = m_cn.OpenSchema(ADODB.SchemaEnum.adSchemaTables,
new object[] {null, null, tableName, "TABLE"}, null);
m_cn is an object of type ADODB.Connection. The variable tableName is a
string holding the name of the table for which schema info is desired.
When the code is exectued, a COMException is thrown with the following
message:
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
I've successfully run this code in VBA as follows:
OpenSchema(adSchemaTables, Array(Empty, Empty Empty, "TABLE"))
Any ideas why the call from .NET is not working? I've successfully run
SELECT, CREATE and UPDATE statements in this environment - it's just
OpenSchema that's giving me problems.
Thanks for your help...
application.
I'm trying to use ADODB.Connection.OpenSchema to return table and column
info from an MS Access database.
Here's the call:
rs = m_cn.OpenSchema(ADODB.SchemaEnum.adSchemaTables,
new object[] {null, null, tableName, "TABLE"}, null);
m_cn is an object of type ADODB.Connection. The variable tableName is a
string holding the name of the table for which schema info is desired.
When the code is exectued, a COMException is thrown with the following
message:
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
I've successfully run this code in VBA as follows:
OpenSchema(adSchemaTables, Array(Empty, Empty Empty, "TABLE"))
Any ideas why the call from .NET is not working? I've successfully run
SELECT, CREATE and UPDATE statements in this environment - it's just
OpenSchema that's giving me problems.
Thanks for your help...