Private Sub msNombreTablas()
Dim loRS As Recordset
Dim lnTotal As Long
Dim lsTipoTabla As String
On Error GoTo Interrupcion
lnTotal = 0
Set loRS = goBD.OpenSchema(adSchemaTables)
If Not loRS.EOF Then
Do While Not loRS.EOF
lsTipoTabla = IIf(Not IsNull(loRS!TABLE_TYPE), loRS!TABLE_TYPE, "")
If UCase(lsTipoTabla) = "TABLE" Then 'Si no es de sistema
MsgBox IIf(Not IsNull(loRS!TABLE_NAME), loRS!TABLE_NAME, "")
lnTotal = lnTotal + 1
End If
loRS.MoveNext
Loop
End If
If loRS.State = 1 Then loRS.Close
Set loRS = Nothing
MsgBox "Total tablas: " & CStr(lnTotal)
Exit Sub
Interrupcion:
On Error Resume Next
If loRS.State = 1 Then loRS.Close
Set loRS = Nothing
On Error GoTo 0
MsgBox Err.Description, vbCritical, "Error"
End Sub