学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

再次请教版主一个问题

再次请教版主一个问题

小弟我设计一个查询表单
要将筛选符合条件的数据以表格形式显示出来
我在一本书上找到一段代码修改了一下作为command的click过程
但是运行老是在where &cxtj into cursor lscanshubiao显示
“不能识别的命令谓词”
麻烦请版主指导一下该怎么修改
private cxtj
if empty(thisform.combo1.displayvalue)or empty(thisform.combo2.displayvalue)or empty(thisform.text1.value)
    wait windows'请输入完整条件!'
thisform.combo1.setfocus
else
   do case
     case alltrim(thisform.combo1.displayvalue)='给料粒度'
      cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
     case alltrim(thisform.combo1.displayvalue)='给料能力'
      cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
     otherwise
      cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+'"'+alltrim(thisform.text1.value)+'"'
    endcase
    select*from canshubiao
    where &cxtj into cursor lscanshubiao
    thisform.grid1.recordsource='lscanshubiao'
    thisform.grid1.backcolor=rgb(200,224,248)
endif

TOP

cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
这几个的运行结果是什么?
生命不息,冲锋不止! 坚持vfp到最后一刻!

TOP

书上是这么写的
我也不是太清楚
好像是给宏赋值吧

TOP

把select*from canshubiao
改成select*from canshubiao;(仅仅是加个分号)
明白为什么了吗?不明白的话就好好看看书。
学无止境 http://bbs.zc268.com

TOP

修改以后运行时在
select*from canshubiao;
提示"操作符/操作数类型不匹配"又是怎么回事啊

TOP

select*from改成select * from  (加空格试试)
学无止境 http://bbs.zc268.com

TOP

连接的结果赋值个变量

引用:
以下是引用 wzxc 在 2008-5-17 20:01 的发言:

cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
这几个的运行结果是什么?
“alltrim”删除前后空格
“thisform.combo1.displayvalue”列表框或组合框(1)中选定项的第一列的内容
“thisform.combo1.disp2ayvalue”列表框或组合框(2)中选定项的第一列的内容
“thisform.text1.value”文本框中输入的内容
“cxtj=”连接的结果赋值个变量“cxtj”

TOP

引用:
以下是引用 啸凡 在 2008-5-18 16:10 的发言:

select*from改成select * from  (加空格试试)
是我把combo1里的一个字段名写错了
改成和canshubiao里一样后就运行出来了
呵呵!
麻烦版主,再次表示感谢!

TOP

发新话题