Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/01/2009, 06:28
Mirador
 
Fecha de Ingreso: abril-2007
Mensajes: 82
Antigüedad: 17 años, 1 mes
Puntos: 0
Respuesta: vb 2003 - Mostrar las tables de un MDB

Solucionado:

Código:
Private Sub sCargarTablas(ByVal strDireccionMDB As String)
        Dim dbConn As OleDb.OleDbConnection
        Dim dbCmd As OleDb.OleDbCommand
        Dim datTable As DataTable
        Dim datRow As DataRow
        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 datRow In datTable.Rows
                    MsgBox(datRow(2))
                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
Saludos!