Please can any one tell how to retirve all table names from mdb file if we just know source file name.
I can do it only in sql server there is a query type looks as(INFORMATION_SCEMA_TABLES) but i need the same rersult with MS Acces file (mdb).
_____________________________
Thanks In Advance.
Loading
heavymetalman75672Posted Jun 9, 2006, 12:56 PM
This will give you a DataTable with the table names in it.public DataTables GetTableNames(OleDbConnection conn)
{
try
{
conn.Open();
DataTable schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" } );
conn.Close();
return schemaTable;
}
catch(Exception ex)
{
// Whatever you do when a problem occurs
return new DataTable(); //empty
}