以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教:查询语句出错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=59554)

--  作者:bahamute
--  发布时间:2014/11/6 14:19:00
--  请教:查询语句出错
提示语法或数据源有错,但是数据源没问题,请帮忙看看语法哪里有错?

窗口afterload

Dim str As String
str=e.Form.Controls("DropBox1").value

If _UserName ="张三" Then
    Tables("录入_Table1").Fill("Select [_Identify],[合同编号],[收付类型],[实收实付金额],[日期],[录入人] From {收款明细记录} Where 合同编号 = \'" & str & "\'and 录入人= \'" & _UserName & "\' and 收付类型=\'收款\'","Main DB",False)

endif

[此贴子已经被作者于2014-11-6 14:21:41编辑过]

--  作者:Bin
--  发布时间:2014/11/6 14:23:00
--  
错误提示发上来,  拼接好的SQL语句弹出截图看看.



--  作者:有点甜
--  发布时间:2014/11/6 14:35:00
--  
Tables("录入_Table1").Fill("Select [_Identify],[合同编号],[收付类型],[实收实付金额],[日期],[录入人] From {收款明细记录} Where 合同编号 = \'" & str & "\' and 录入人= \'" & _UserName & "\' and 收付类型=\'收款\'","Main DB",False)