参考,稍改下就好了
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
Screen.MousePointer = 11
Dim rstSchema As ADODB.Recordset
cboTablesName.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
cboTablesName.AddItem rstSchema!TABLE_NAME
End If
rstSchema.MoveNext
Loop