Programación General > VBA
Nombres De Campos De Una Bds
Shiquilla:
--- Código: Text ---Private Sub msNombreTablas()Dim loRS As RecordsetDim lnTotal As LongDim 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 SubInterrupcion: 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
* goBD sería la conexión a la base de datos
Saludos,
JMAlonso:
Gracias y saludos.
Navegación
[*] Página Anterior
Ir a la versión completa