Read all tables of database

SIMIN

Well-known member
Joined
Mar 10, 2008
Messages
92
Hi forum members! :)
I have a question in my mind:
I want to read from an Access .mdb database file.
This code works if I want to read the contents of a specific table from database:
Code:
Dim StringConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileTextBox.Text + ";Jet OLEDB:Database Password = " + PasswordTextBox.Text
Dim MyConnection As New OleDbConnection(StringConnection)
MyConnection.Open()
Dim MyCommands As New OleDbCommand("SELECT * FROM MyTable", MyConnection)
MyConnection.Close()
However, I want to do a different thing!
I dont know if my database has any tables or not? Perhaps it has, so I just want to get the name of all tables in database.
How can I get the name of all tables in database using the above code?
Thank you friends :)
 
Back
Top