View RSS Feed

Recent Blogs Posts

  1. Getting a list of tables in an Access database (C#)

    by , 4th March 2011 at 12:13 PM
    Posting this code so that I can remember it/ and in case anyone else finds it useful.

    First open the database
    string constr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source=database.mdb";
    OleDbConnection con = new OleDbConnection(constr);
    con.GetSchema() will return a list of collections in the database.

    CollectionName        NumberOfRestrictions NumberOfIdentifierParts
    --------------------- --------------------