直接写
r Each t As Table In Tables
t.Visible = True
t.AllowEdit = True
For Each c As Col In t.Cols
c.Visible = True
c.AllowEdit = True
Next
Next
For Each dr As DataRow In DataTables("用户授权表").Select("姓名 = '" & _UserName & "'" )
MessageBox.Show("1")
If dr.IsNull("受限列的名称") Then
Tables(dr("受限表的名称")).Visible = Not dr("不可见")
Tables(dr("受限表的名称")).AllowEdit = Not dr("不可编辑")
Else
Tables(dr("受限表的名称")).Cols(dr("受限列的名称")).Visible = Not dr("不可见")
Tables(dr("受限表的名称")).Cols(dr("受限列的名称")).AllowEdit = Not dr("不可编辑")
End If
Next