破伤风皮试阳性表现:asp问题 数据库查询类

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 19:01:27
要实现这句
select * from table where id='1'
把字段1给一个变量
strid="1"
上面的语句该怎么写?
如果是sql="select * from table where"&strid
这样的只能查询到
select * from table where id=1
不能查询到
select * from table where id='1'
是不是数据类型有问题 ?
要怎么改?

我估计你的id可能是数据库自动分配的那种,应该是字符型,所以你直接写id=1是不可以的,我前面也回答你这个问题了
你还可以这样写试一试
sql="select * from table where id='"+strid+"'"

strid你就赋值就可以,试一试,不行再说,我再给你方案,呵呵