我有段程序不能运行rst.open"select*from t where "xuehao" & text1.text &"",con,1,1"

来源:百度知道 编辑:UC知道 时间:2024/06/28 23:56:15

如果 xuehao 字段是字符串类型:
rst.open "select * from t where xuehao='"&text1.text&"'",con,1,1

如果 xuehao 字段是数字类型:
rst.open "select*from t where xuehao="&text1.text,con,1,1

如果 xuehao 字段是字符串类型,并且要搜索 xuehao 字段:
rst.open "select * from t where xuehao like '%"& text1.text &"%'",con,1,1

建议先将 text1.text 值过滤后再进行查询