以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=70145)

--  作者:hbhb
--  发布时间:2015/6/16 15:40:00
--  请教
大师:为何下面的语句显示没有为类型定义运算符连接”&“
cmd.CommandText = "select " & qslname & "f rom  {" & tb & "} where " & filname2 & " = \'" & filname22 & "\'"


--  作者:hbhb
--  发布时间:2015/6/16 15:43:00
--  
知道了
--  作者:唐尸三摆手
--  发布时间:2015/6/16 15:53:00
--  

Foxtable专门提供了一个名为CExp的函数,可以用更清晰的方式动态合成表达式。

语法:

CExp(StrExp, V0, V1, V2, ...)

StrExp:    要合成的表达式,包含位置标记,{0}表示第一个值,{1}表示第二个值,{2}表示第三个值...
V0,V1,V2: 用于替换位置标记的值,V0替换{0},V1替换{1},V0替换{0}...

 

 

养成良好的编程习惯,用CExp方法能让你的代码更清晰。

cmd.CommandText = CExp("Se lect StudentId,StudentName from StudentInfo where ClassName = \'{0}\'",e.row("ClassName"))