ADO
Sub test()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim fld As ADODB.field
Dim arr()
cnn.Open "provider=microsoft.jet.oledb.4.0;data source=" & ThisWorkbook.Path & "\BssV18.mdb;"
Set cnnschema = cnn.openschema(adSchemaTables)
i = 1
Do Until cnnschema.EOF
Cells(i, 1) = cnnschema!table_name
cnnschema.MoveNext
i = i + 1
Loop
End Sub
DAO
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("表名")
rst.MoveFirst
Do Until rst.EOF
If IsNull(rst![字段名]) = False Then
要执行的东东
End If
rst.MoveNext
Loop
rst.Close
网友评论