如题,表采用的是SQL外部表,在Initialize中修改列标题出错,在命令窗口中执行能正常修改,求解?以下为数据库文件和项目文件:
数据库文件上传不了,提示错误:文件类型不正确!
代码为
Dim lst As List(Of String)
lst = Connections("hbposv7").GetTableNames
For Each nm As String In lst
If nm > "pbcatcol" Then '此表不需要设置列标题
If DataTables.Contains(nm) Then '如果nm表已经存在
With DataTables("pbcatcol")
.LoadFilter = "[pbc_tnam] ='" & nm & "'"
.Load()
If .DataRows.Count > 0 Then
For Each dr As DataRow In .DataRows
'DataTables(dr("pbc_tnam").TrimEnd).DataCols(dr("pbc_cnam")).Caption = dr("pbc_hdr")
DataTables(nm).DataCols(dr("pbc_cnam").trimend()).Caption = dr("pbc_hdr")
DataTables(nm).BuildHeader()
Next
End If
End With
End If
End If
Next
[此贴子已经被作者于2017/8/11 3:25:40编辑过]