帮我解释下里面代码中打开数据库语句!
麻烦好心人耐心帮我看下这段代码,有个数据库调用语句看不懂,搞的我自学不下去.<TABLE width=767 height=50 border=0 align="center" cellPadding=0 cellSpacing=0 id=__01>
<TBODY>
<TR>
<TD width="218" valign="top">
<!--#include file="login.asp"-->
<!--#include file="cd.asp"-->
<!-- End ImageReady Slices --></TD>
<TD width="549" valign="top" bgcolor="#FFFFFF"><span class="td02">
<%
if request("TypeNo")<>"" then
opendb "","proType","TypeNo='"&request("TypeNo")&"'","","",typeno
title=typeno("TypeNameEn")
TextCom=typeno("contente")
opendb "","proType","id="&typeno("PID"),"","",PType
title = PType("TypeNameEn") & " > " & title
closedb typeno
closedb PType
end if
%>
</span>
<TABLE width=549 border=0 cellPadding=0 cellSpacing=0 background="images/line_lv.gif" id=__01>
<TBODY>
<TR>
<TD><IMG height=15 alt="" src="images/4_02.gif" width=549></TD>
</TR>
<TR>
<TD><IMG height=32 alt="" src="images/custom.gif" width=549></TD>
</TR>
<TR>
<TD height="94" valign="top" background="images/line_lv2.gif" class="about_index" style="padding:8px;">
<%
if request("TypeNo")<>"" then
lmid=221
opendb "","news","(lm='"&lmid&"' or lm2='"&lmid&"' or lm3='"&lmid&"')","","",rss
if not rss.eof then
content= rss("contente")
else
content= "<center><br><br>In data compilation</center>"
end if
closedb rss
response.Write TextCom
else
response.write" We are able to provide customers a wide range of toy products, including remote control toys, electric toys, ..........."
end if
这个打开数据库自定义函数func.asp是下面:
'========打开数据库===================================================
'TD 数据库字段名,可以为空
'TB 数据库表名
'WHERE 查询条件
'BY 以哪个字段排序
'PX 排序方式,1 为正序 ,2为倒序
'SS 数据集名
'
'=====================================================================
function openDB(tu,tb,where,by,px,ss)
dim qq,where2,by2,px2
if tu="" then
tu="*"
end if
if where="" then
where2=""
else
where2=" where "&where
end if
if by="" then
by2=""
else
by2=split(by,",")
if px<>"" then
px2=split(px,",")
end if
for i=0 to ubound(px2)
if px2(i)=1 then
px2(i)=" asc"
else
px2(i)=" desc"
end if
next
redim preserve px2(ubound(by2))
for i=0 to ubound(by2)
if px2(i)="" then px2(i)=" desc"
by3=by3&","&by2(i)&px2(i)
next
by3=right(by3,len(by3)-1)
by4=" order by "&by3
end if
qq="select "&tu&" from "&tb&where2&by4
set ss=server.createobject("adodb.recordset")
ss.open qq,conn,3,3
end function
======================================================================
疑问:opendb "","news","(lm='"&lmid&"' or lm2='"&lmid&"' or lm3='"&lmid&"')","","",rss 这个调用
是不是打开数据库中news表啊?但是表里没有什么内容. 也没有“contente”这个字段啊。 lmid=221 ,(lm='"&lmid&"' or lm2='"&lmid&"' or lm3='"&lmid&"')怎么理解啊?