I need to see if a table exists in an Access database used by my c# program. Is know there are SQL commands for other databases that will return a list of tables. Is there such a command for Access/Jet databases?
Click on the View tab and check System objects. If you are using Microsoft Access 2007, 2010, 2013, or 2016, right-click on the navigation pane (just above the search box) and choose Navigation Options. Then, under display options, check Show System Objects and press OK.
Try the GetSchema()
connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\access.mdb";
connection.Open();
DataTable userTables = connection.GetSchema("Tables");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With