fields.count和fields(i).name的属性可以解决问题

解决方案 »

  1.   

    用枚举的方法,加上一个判断条件,具体如下:
    添加一个对Microsoft ADO Data EXt. 2.1 and Security 的引用和Microsoft ADO Data Object对象的引用,添加一个模块,在模块中加入下列代码:
    dim fid as new adodb.field
    dim rst as new recordset
    Sub main()
      With cnn
        .CursorLocation = adUseServer
        .ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" & _ App.Path & "\你的数据库名称.mdb;persist security info=false"
        .Open
      End With
      Form1.Show
    End Sub
    在Form1窗体中加入一个命令按钮和一个List Box控件,接受默认名称,在按钮中加入下列代码:
    Private Sub Command1_Click() Dim cat As New Catalog
     Dim tal As New Table
     Dim i As Integer
     Set cat.ActiveConnection = cnn
     For Each tal In cat.Tables
       If Mid(tal.Name, 1, 2) <> "MS" Then   '去掉系统表
         List1.AddItem tal.Name   '枚举表名称,根据需要,你可以在If 判断条件中加入自己的条件。
       End If
     Next
    End Sub
      

  2.   

    用枚举的方法,加上一个判断条件,具体如下:
    添加一个对Microsoft ADO Data EXt. 2.1 and Security 的引用和Microsoft ADO Data Object对象的引用,添加一个模块,在模块中加入下列代码:
    dim fid as new adodb.field
    dim rst as new recordset
    Sub main()
      With cnn
        .CursorLocation = adUseServer
        .ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" & _ App.Path & "\你的数据库名称.mdb;persist security info=false"
        .Open
      End With
      Form1.Show
    End Sub
    在Form1窗体中加入一个命令按钮和一个List Box控件,接受默认名称,在按钮中加入下列代码:
    Private Sub Command1_Click() Dim cat As New Catalog
     Dim tal As New Table
     Dim i As Integer
     Set cat.ActiveConnection = cnn
     For Each tal In cat.Tables
       If Mid(tal.Name, 1, 2) <> "MS" Then   '去掉系统表
         List1.AddItem tal.Name   '枚举表名称,根据需要,你可以在If 判断条件中加入自己的条件。
       End If
     Next
    End Sub
      

  3.   

    用枚举的方法,加上一个判断条件,具体如下:
    添加一个对Microsoft ADO Data EXt. 2.1 and Security 的引用和Microsoft ADO Data Object对象的引用,添加一个模块,在模块中加入下列代码:
    dim fid as new adodb.field
    dim rst as new recordset
    Sub main()
      With cnn
        .CursorLocation = adUseServer
        .ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" & _ App.Path & "\你的数据库名称.mdb;persist security info=false"
        .Open
      End With
      Form1.Show
    End Sub
    在Form1窗体中加入一个命令按钮和一个List Box控件,接受默认名称,在按钮中加入下列代码:
    Private Sub Command1_Click() Dim cat As New Catalog
     Dim tal As New Table
     Dim i As Integer
     Set cat.ActiveConnection = cnn
     For Each tal In cat.Tables
       If Mid(tal.Name, 1, 2) <> "MS" Then   '去掉系统表
         List1.AddItem tal.Name   '枚举表名称,根据需要,你可以在If 判断条件中加入自己的条件。
       End If
     Next
    End Sub