我已经在论坛找到了解决方案,感谢DimVar()提供
Function GetTables(cnn As ADODB.Connection) As Boolean
'Purpose : Get table names from the Connection given
'Input : cnn, ther ADODB.Connection
'Output : TRUE/FALSE
'
On Error GoTo GetTables_ErrorHandler
Dim rstSchema As ADODB.Recordset
Combo2.Clear
Set rstSchema = cnn.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "Table"))
Do Until rstSchema.EOF
If StrComp(Left(rstSchema!TABLE_NAME, 4), "MSys", vbTextCompare) <> 0 Then
Combo2.AddItem rstSchema!TABLE_NAME
End If
rstSchema.MoveNext
Loop
rstSchema.Close
Set rstSchema = Nothing
Screen.MousePointer = 0
ErrorHandler:
Exit Function
GetTables_ErrorHandler:
Screen.MousePointer = 0
MsgBox Err.Description
Resume ErrorHandler
End Function