txtsql = "select * from project_spec where type = '" & Opt_inner.Value & "'"
这是我要执行的SQL语句,根据单选按钮的选择与否来找出相关记录,用的数据库为access,该字段的类型为 “是/否”中的“真/假“,不知道何故如此!
这是我要执行的SQL语句,根据单选按钮的选择与否来找出相关记录,用的数据库为access,该字段的类型为 “是/否”中的“真/假“,不知道何故如此!
dim s as stringselect case Opt_inner.Value
case 0
s="false"
case 1
s="true"
end select txtsql = "select * from project_spec where type = " & s & ""
字符串才需要用'括起来,试试
txtsql = "select * from project_spec where type = " & cbool(Opt_inner.Value)