| 发表于:2007-10-09 22:03:39 楼主 |
我在程序中作了一个查询按钮如下 private sub cmdser_click() dim str as variant if text1.text <> "" then str = "yhmc like '%" & text1.text & "%'" end if if text2.text <> "" then if str = "" then str = "yhkl like '%" & text2.text & "%'" else str = str & " and yhkl like '%" & text2.text & "%'" end if end if adodc1.recordset.filter = str---------------错误指向这里 end sub 如果是这样的话,按钮是好用的而且能够查找到数据 adodc1.commandtype = adcmdtext adodc1.recordsource = "select * from companyuser order by xuhao" adodc1.refresh 但是如果改成这个样子的话就会抱错:"在所对应的名称或序数集合中,未找到项目" adodc1.commandtype = adcmdtext adodc1.recordsource = "select xuhao as 序号,yhmc as 名称,yhkl as 密码,yhqx as 权限 ,js as 数值,lr as 录入人 from companyuser order by xuhao" adodc1.refresh 还请各位高手指点指点 |
|
|
|
|