执行下面的代码,可以达到效果。
Dim lie,biao,bds As String
lie = Tables("取数函数表").Current("增加列名称")
biao = Tables("取数函数表").Current("表名")
bds = Tables("取数函数表").Current("取数表达式")
Dim ld As String
Dim code As String = ""
code += "Dim ld as String" & vbcrlf
code += "Dim cmd As New SQLCommand" & vbcrlf
code += "cmd.CommandText = ""Select " & lie & " From {" & biao & "} Where " & bds & """" & vbcrlf
code += "return cmd.ExecuteScalar()"
Functions.Remove("execSql")
Functions.Add("execSql",Code)
Functions.Complie()
ld = Functions.Execute("execSql")
Output.SHOW(LD)