Home All Groups Group Topic Archive Search About

GetOleDbSchemaTable

Author
17 Feb 2006 7:35 AM
Hideen
I writing program in Visual Studio C++ Exprees 2005.

...
conn->Open();

DataTable^ GetTables(OleDbConnection^ conn)
{
array<Object ^> restrictions[] = {"0", "0", "0", "TABLE"};

DataTable^ schemaTable =
conn->GetOleDbSchemaTable(OleDbSchemaGuid::Tables,
restrictions);
conn->Close();
return schemaTable;
};

When I run my program receive error:
"Incorrect parameter" What is wrong ?


Now I write my programe like this:

try
{
DataTable^ schemaTable = con->GetOleDbSchemaTable(OleDbSchemaGuid::Tables,
gcnew array<Object^> {"\0","\0","\0","Table"});
return schemaTable;
}
catch (OleDbException^ ex)
{
MessageBox::Show(ex->StackTrace,"1",
MessageBoxButtons::OKCancel,MessageBoxIcon::Asterisk);
}

and receive:
incorrect parameter

at System.Data.OleDb.OleDbConnectionInternal.GetSchemaRowset(Guid schema,
Object[] restrictions)
at System.Data.OleDb.OleDbConnection.GetOleDbSchemaTable(Guid schema,
Object[] restrictions)
at xxx.Form1.GetTables(OleDbConnection con) in c:\documents and
settings\mattx\moje dokumenty\visual studio
2005\projects\xxx\xxx\form1.h:line 69
at xxx.Form1.DataBaseCheck() in c:\documents and settings\mattx\moje
dokumenty\visual studio 2005\projects\xxx\xxx\form1.h:line 386

What is wrong ?

Help me !!!

AddThis Social Bookmark Button