\'生成表结构表"Table("表结构")"--------------------------------
Dim Builder As New ADOXBuilder
Dim tbl As ADOXTable
Builder.Open()
If DataTables.Contains("表结构") Then
Builder.DeleteTable("表结构")
Syscmd.Project.Open(ProjectFile)
Else
tbl = Builder.NewTable("表结构") \'创建表
With tbl
.AddColumn("列名" ,ADOXType.String, 20)
.AddColumn("类型" ,ADOXType.String, 15)
.AddColumn("长度" ,ADOXType.Integer)
.AddColumn("标题" ,ADOXType.String, 20)
.AddColumn("表达式" ,ADOXType.String, 200)
End With
Builder.AddTable(tbl) \'增加表
Builder.Close()
Syscmd.Project.Open(ProjectFile)
End If
\'----------------------------------------------------------------
\'将主表的表结构数据写入"Table("表结构")"中------------------------
With MainTable
Dim t As Table = Tables("表结构")
For Each c As Col In .Cols
Dim r As Row = t.AddNew()
r("列名") = c.Name
r("类型") = c.DataCol.DataType.Name
r("长度") = c.DataCol.MaxLength
r("标题") = c.Caption
r("表达式") = c.DataCol.Expression
Next
End With
\'------------------------------------------------------------------