asp产品分类代码问题
<tdalign="center"valign="top"><%setrs_big=server.CreateObject("adodb.recordset")exec=...
<td align="center" valign="top">
<% set rs_big=server.CreateObject("adodb.recordset")
exec="select * from picclass"
rs_big.open exec,conn,1,1
if rs_big.recordcount=0 then
response.write("暂无分类!")
end if %>
<% do while not rs_big.eof %>
<table width="770" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" bgcolor="#f9f9f9"> <b><%= rs_big("pic_class") %></b></td>
</tr>
<tr>
<td align="center"><table><tr><td height="3"></td></tr></table>
<%
set rs_small=server.CreateObject("adodb.recordset")
exec="select * from pic where pic_class="&rs_big("pic_class")&" oder by id desc "
rs_small.open exec,conn,1,1
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF9900">
<%
j=1
do while not rs_small.eof
if (j mod 3)=1 then
response.write "<tr>"
end if
%>
<td align="center" valign="top" whith="200"><table width="110" height="84" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td width="304" align="center" bgcolor="#FFFFFF"><table width="158" height="111" border="0" cellpadding="0" cellspacing="0" background="img/tablebg.gif">
<tr>
<td align="center" valign="middle"><%If rs_small("pic_url")<>"" then%>
<a href="show_pic.asp?id=<%=rs_small("id")%>" target="_blank"> <img src="<%=rs("pic_url")%>" width="128" height="80" border="0" align="center"></a>
<% Elseif rs_small("pic_lurl")<>"" then %>
<a href="show_pic.asp?id=<%=rs_small("id")%>" target="_blank"> <img src="<%=rs("pic_lurl")%>" width="128" height="80" border="0" align="center"></a>
<% Else %>
<font color="gray">暂无图片</font>
<%End If%>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
<%
if (j mod 3)=0 then
response.write "</tr>"
end if
j=j+1
rs_small.moveNext
loop
%>
</table>
<% rs_big.movenext
loop %>
谁能帮我看一下哪里不对,一直说<%
set rs_small=server.CreateObject("adodb.recordset")
exec="select * from pic where pic_class="&rs_big("pic_class")&" oder by id desc "
rs_small.open exec,conn,1,1
%>
这一段中:Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("date/#picc_date.mdb")
%>
这个是conn.asp的文件
我把'"&rs_big("pic_class")&"' 改成单引后变成上面一段<% set rs_big=server.CreateObject("adodb.recordset")
exec="select * from picclass"
rs_big.open exec,conn,1,1
if rs_big.recordcount=0 then
response.write("暂无分类!")
end if %>
<% do while not rs_big.eof %>
出现错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。 展开
<% set rs_big=server.CreateObject("adodb.recordset")
exec="select * from picclass"
rs_big.open exec,conn,1,1
if rs_big.recordcount=0 then
response.write("暂无分类!")
end if %>
<% do while not rs_big.eof %>
<table width="770" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" bgcolor="#f9f9f9"> <b><%= rs_big("pic_class") %></b></td>
</tr>
<tr>
<td align="center"><table><tr><td height="3"></td></tr></table>
<%
set rs_small=server.CreateObject("adodb.recordset")
exec="select * from pic where pic_class="&rs_big("pic_class")&" oder by id desc "
rs_small.open exec,conn,1,1
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF9900">
<%
j=1
do while not rs_small.eof
if (j mod 3)=1 then
response.write "<tr>"
end if
%>
<td align="center" valign="top" whith="200"><table width="110" height="84" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td width="304" align="center" bgcolor="#FFFFFF"><table width="158" height="111" border="0" cellpadding="0" cellspacing="0" background="img/tablebg.gif">
<tr>
<td align="center" valign="middle"><%If rs_small("pic_url")<>"" then%>
<a href="show_pic.asp?id=<%=rs_small("id")%>" target="_blank"> <img src="<%=rs("pic_url")%>" width="128" height="80" border="0" align="center"></a>
<% Elseif rs_small("pic_lurl")<>"" then %>
<a href="show_pic.asp?id=<%=rs_small("id")%>" target="_blank"> <img src="<%=rs("pic_lurl")%>" width="128" height="80" border="0" align="center"></a>
<% Else %>
<font color="gray">暂无图片</font>
<%End If%>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
<%
if (j mod 3)=0 then
response.write "</tr>"
end if
j=j+1
rs_small.moveNext
loop
%>
</table>
<% rs_big.movenext
loop %>
谁能帮我看一下哪里不对,一直说<%
set rs_small=server.CreateObject("adodb.recordset")
exec="select * from pic where pic_class="&rs_big("pic_class")&" oder by id desc "
rs_small.open exec,conn,1,1
%>
这一段中:Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("date/#picc_date.mdb")
%>
这个是conn.asp的文件
我把'"&rs_big("pic_class")&"' 改成单引后变成上面一段<% set rs_big=server.CreateObject("adodb.recordset")
exec="select * from picclass"
rs_big.open exec,conn,1,1
if rs_big.recordcount=0 then
response.write("暂无分类!")
end if %>
<% do while not rs_big.eof %>
出现错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。 展开
展开全部
代码没错,把CONN文件中的连库代码贴出来,应该是那出错了
<%
dim conn
Set conn=Server.CreateObject("ADODB.Connection")
SqlLocalName ="(local)" '连接IP [ 本地用 (local) 外地用IP ]
SqlUsername ="sa" '用户名
SqlPassword ="sa" '用户密码
SqlDatabaseName="ap_create" '数据库名
ConnStr = "Provider=Sqloledb;User ID=" & SqlUsername & "; Password=" & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source=" & SqlLocalName & ";"
conn.open ConnStr
%>
<%
dim conn
Set conn=Server.CreateObject("ADODB.Connection")
SqlLocalName ="(local)" '连接IP [ 本地用 (local) 外地用IP ]
SqlUsername ="sa" '用户名
SqlPassword ="sa" '用户密码
SqlDatabaseName="ap_create" '数据库名
ConnStr = "Provider=Sqloledb;User ID=" & SqlUsername & "; Password=" & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source=" & SqlLocalName & ";"
conn.open ConnStr
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
rs_big("pic_class")是什么类型?
文本要加单引
exec="select * from pic where pic_class='"&rs_big("pic_class")&"' oder by id desc "
文本要加单引
exec="select * from pic where pic_class='"&rs_big("pic_class")&"' oder by id desc "
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询