Georges Bessis said:
Easy in DAO but can't find a way with ADO.Net :
How to obtain the list of all tables (names) of an Access Database in VB.Net?
Thanks in advance.
GB
Something like this:
Dim mytbl As String
' Open the connection.
accessConnection.Open()
'Get how many tables this datafile has
Dim schemaTable As DataTable = accessConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing,
Nothing, "TABLE"})
'get the table name
Dim i As Integer = 0
Dim r As DataRow
For Each r In schemaTable.Rows
mytbl = r("TABLE_NAME").ToString()
Listbox1.Items.Add(mytbl).ToString
Next r
*************************
This is the easist way I have found to get Table Names.
james