以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  控件值不可以这样取值吗?----期待专家指点.  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=56448)

--  作者:fox-man
--  发布时间:2014/9/5 12:27:00
--  控件值不可以这样取值吗?----期待专家指点.

select a.产品  from tb a   \'可执行
select a.\'"& e.Form.Controls("textbox1").text & "\' from tb a \'错误提示

select * from tb  where 产品 in (\'产品1\',\'产品2\')         \'可执行
select * from tb  where 产品 in (\'\'"& e.Form.Controls("textbox1").text & "\' ,\'\'"& e.Form.Controls("textbox2").text & "\' ) \'错误提示

select * from tb 
where  isnull(数量,\'0\')>0 \'可执行
select * from tb  where isnull(\'"& e.Form.Controls("textbox11").text & "\',\'0\')>0     \'错误提示

 

select * from tb where 产品 =\'产品1\'
select * from tb where 产品 =\'\'"& e.Form.Controls("textbox1").text & "\' \'

应该怎么写呢?

[此贴子已经被作者于2014-9-5 12:53:08编辑过]

--  作者:blackzhu
--  发布时间:2014/9/5 13:07:00
--  
你要干吗?

可以这样写:


select * from tb where 产品 =\'"&  e.Form.Controls("textbox1").text  & "\' "

--  作者:fox-man
--  发布时间:2014/9/5 13:22:00
--  

SQL查询语句,以上几种写法都报错.

 


--  作者:有点甜
--  发布时间:2014/9/5 14:09:00
--  

 不要写引号啊!

 

select a.产品  from tb a   \'可执行
select a."& e.Form.Controls("textbox1").text & " from tb a \'错误提示


--  作者:fox-man
--  发布时间:2014/9/10 16:46:00
--  
图片点击可在新窗口打开查看图片点击可在新窗口打开查看