ASP条件语句问题

来源:百度知道 编辑:UC知道 时间:2024/09/22 16:37:42
表的结构是:id 自动编号
name 备注
gaishu 备注
bingyin 备注
neibie 备注
我要读取 neibie= 女性盆骨 的内容 其他的不管,下面是我写的代码,为什么不对。帮我分析测试下好吗? 我会追加分的哦!!!
<%
Set conn = Server.CreateObject("ADODB.Connection")
Strconn="DRIVER={Microsoft Access Driver (*.mdb)}; " & "DBQ=" & Server.MapPath("yyk.mdb")
conn.Open Strconn
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from jibing where neibie='女性盆骨' "
rs.open sql,conn,1,1,1

rs.pagesize=30
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>

<title>医药招商百事通--代理信息库</title>
<table width="70%" height=&

我给你说一下,
sql="select * from jibing where neibie='"女性盆骨"'"
这句是错误的,本来这句语句解释后是这样的
select * from jibing where neibie="女性盆骨"
这样的话你把它还原回去就是,
sql="select * from jibing where neibie='女性盆骨'"
这是因为你外边有了一个双引号,所以里边的那个换成单引号,要注意,在半角英文下的标点!!

sql="select * from jibing where neibie=女性盆骨"
sql="select * from jibing where neibie='女性盆骨'"

两个错

rs.open sql,conn,1,1,1???????????
应是rs.open sql,conn,1,1

sql="select * from jibing where neibie=女性盆骨"

sql="select * from jibing where neibie='女性盆骨' "
rs.open sql,conn,1,1,1
你哪个字段最好是文本类型
rs.open sql,conn,1,1,1
还有咋个弄成三个1呢?我记得只有一个油标一个索引的嘛.
rs.open sql,conn,1,1

你的数据库里neibie跟代码了写的neibie是不是有出入的地方啊。就是写错字母。
还有表名是不是对啊。?

while (dr.Read())
{
i++;
}
int j = i;
Database db1 =