Foxtable(狐表)用户栏目专家坐堂 → 请教:在另表取表B所有列名称


  共有14490人关注过本帖树形打印复制链接

主题:请教:在另表取表B所有列名称

帅哥哟,离线,有人找我吗?
Fotable
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1015 积分:6979 威望:0 精华:0 注册:2012/8/1 18:41:00
  发帖心情 Post By:2012/8/10 16:07:00 [显示全部帖子]

你只要增加一个叫 表对照 的表 剩下的万能代码帮你搞定

 

Dim dc As DataCol
Dim i As Integer = 0
For Each dt As DataTable In DataTables
    DataTables("表对照").DataCols.Add( dt.name,Gettype(String) )
    With Tables("表对照")
        .position = 0
        i = 0
        For Each dc  In dt.DataCols
            If i >= .Rows.count
                .AddNew()
            End If
            .Rows(.position )(dt.name)=dc.Name
            i=i+1
            .position = i
        Next
    End With
Next


 回到顶部