Me detecta el número de tablas que contiene, pero no se como sacar el nombre de ellas. Espero puedan guiarme de alguna forma:
Código:
Saludos!Private Sub sCargarTablas(ByVal strDireccionMDB As String) Dim dbConn As OleDb.OleDbConnection Dim dbCmd As OleDb.OleDbCommand Dim datTable As DataTable Dim tab As New DataTable Dim i As Integer Try dbConn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDireccionMDB & ";") dbConn.Open() datTable = dbConn.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"}) If datTable.Rows.Count > 0 Then For Each tab In datTable.DataSet.Tables MsgBox(tab.TableName) Next Me.lstTablas.Enabled = True Else MsgBox("La mdb seleccionada no contiene ninguna tabla", MsgBoxStyle.OKOnly, "Atención") End If Catch ex As Exception Call MsgBox("Error: " & ex.Message & vbNewLine & "Traza: " & ex.StackTrace) End Try End Sub
