还是不行呀!还是不行呀!我使用一条固定的语句可以实现,但我想把where后边的条件 用变量来替代就又出问题了呀! 用一个文本框 ,在把输入 的信息放入语句后就会出错了!conditions = thisform.text1.valuethisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名=" &conditions+"into cursor temp1" 但这样提示写出错了! 应该怎么做呢!?
这样改 thisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名=" +conditions+"into cursor temp1" recordsource是一个整的字符串
每次查询之前,把conditions替换为你的条件如: thisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名='" conditions + "' into cursor temp1这样就可以了,原因是conditions局部变量,而Grid在表单级,如果把conditions设置为公共变量也可以,但是不推荐这么做
哦,我想起来了,我想应该是样: conditions = Alltrim(thisform.text1.value) &&将控年中的前后空格过滤掉 thisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名=&conditions into cursor temp1" 帖主试试吧!
用变量来替代就又出问题了呀!
用一个文本框 ,在把输入 的信息放入语句后就会出错了!conditions = thisform.text1.valuethisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名=" &conditions+"into cursor temp1"
但这样提示写出错了!
应该怎么做呢!?
thisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名=" +conditions+"into cursor temp1"
recordsource是一个整的字符串
thisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名='" conditions + "' into cursor temp1这样就可以了,原因是conditions局部变量,而Grid在表单级,如果把conditions设置为公共变量也可以,但是不推荐这么做
conditions = Alltrim(thisform.text1.value) &&将控年中的前后空格过滤掉
thisform.pageframe1.page2.grid1.recordsource="select 编号,姓名,工作经历,学习经历,培训经历,个简奖惩,主要社关,社关备注 from acard where acard.姓名=&conditions into cursor temp1" 帖主试试吧!