Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
有这样几行代码是可以执行的:
Dim q As new QueryBuilder
q.TableName = "会计凭证查询"
q.C
dim s as string
s = "select * from [z_tabdqpz] where sszt = "& e.Form.Controls("账套编号").Value &"and pzrqn = "& e.Form.Controls("账套年度").Value
s = s & "union all select * from [z_tabxqpz] where sszt = "& e.Form.Controls("账套编号").Value &"and pzrqn = "& e.Form.Controls("账套年度").Value
s = s & "union all select * from [z_tablqpz] where sszt = "& e.Form.Controls("账套编号").Value &"and pzrqn = "& e.Form.Controls("账套年度").Value
s = s & "order by pzrqn,pzrqy,pzlx,pzdm,flxh"
q.SelectString = s
q.Build
但是我用定义的变量写入select中,就不能执行了:
Dim ztnd As WinForm.TextBox = e.Form.Controls("账套年度").ValueDim ztbh As WinForm.TextBox = e.Form.Controls("账套编号").Value
Dim q As new QueryBuilder
q.TableName = "会计凭证查询"
q.C
dim s as string
s = "select * from [z_tabdqpz] where sszt = "& ztbh &"and pzrqn = "& ztnd
s = s & "union all select * from [z_tabxqpz] where sszt = "& ztbh &"and pzrqn = ztnd
s = s & "union all select * from [z_tablqpz] where sszt = "& ztbh &"and pzrqn = ztnd
s = s & "order by pzrqn,pzrqy,pzlx,pzdm,flxh"
q.SelectString = s
q.Build
规则本来就是这样的吗?
Dim ztbh As WinForm.TextBox = e.Form.Controls("账套编号").Value
这两行有问题的,我猜应该这样:
Dim ztnd As Integer = e.Form.Controls("账套年度").Value
Dim ztbh As Integer = e.Form.Controls("账套编号").Value
具体看数据类型。
我想是这样的。
这个是双击自动生成的,我没在意它会错。
自动生成的可没有错,是你错了。
原因你自己想想。
我要的是一个整数值。
但定义的是一个WinForm.TextBox 。
所以不对头。
低级的错误。