Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

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 don't 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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...