asp 数据库简单问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 16:56:02
当时的id1字段在数据库当中的数据类型是(数据型)
我在网页中用的SQL语句是:
str="select * from table1 where id=10007"
但是我现在把id1这个字段的数据类型改称了(文本型)
那我现在的SQL语句该怎么写呢?
我用的数据库是access

str="select * from table1 where id1='10007'"

加上单引号就可以了。

欢迎访问我的论坛:)
http://www.chinesebloger.com

去网页里搜索吧,
里边很多的。

1、把id1字段的值加上一对单引号就可以了。
str="select * from table1 where id1='10007'"
2、把id1字段改成数据型也可以。
str="select * from table1 where int(id1)=10007"

10007加对引号即可