主题:  谁能帮我?

zerlo

职务:普通成员
等级:1
金币:0.0
发贴:1
注册:2003/7/1 20:38:36
#12003/7/1 20:46:55
我有一个ACCESS数据库文件.目的是让他把数据显示出来.
Article
newid    typeid    shenghe    yes    selectpic    path    N_fname    title    dateandtime
1    101    1    1    0    mainfn    fjjj.html        2003-6-27 20:50:22
2    102    1    1    0    mainfn    jgsz.html        2003-6-27 20:52:09
3    103    1    1    0    mainfn    mjfj.html        2003-6-27 20:52:33
4    104    1    1    0    mainfn    zywj.html        2003-6-27 20:52:57
5    105    1    1    0    mainfn    hmcx.html        2003-6-27 20:53:11
6    106    1    1    0    mainfn    xxyd.html        2003-6-27 20:53:31
7    107    1    1    0    tztg    200252395758.htm        2003-6-27 20:54:03
8    108    1    1    0    tztg    2003128100029.htm        2003-6-27 20:55:00
9    109    1    1    0    tztg    200312891339.htm        2003-6-27 20:58:46
10    110    1    1    0    tztg    200312891812.htm        2003-6-27 20:58:55
11    111    1    1    0    tztg    200312892034.htm        2003-6-27 20:59:04
12    112    1    1    0    tztg    200312892218.htm        2003-6-27 20:59:06

请问我怎样用ASP网页程序打开它.我参照别人的是这样打开的.
conn.asp
<%
dim conn
dim connstr

on error resume next
connstr="DBQ="+server.mappath("database/plice.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
if err then
err.clear
end if
end if
%>
这可能是初使化数据库系统.
下面是一段调用的程序:参数为:newstype="数据" typeid=108 n=5
typeid的意思是让他可以滚屏,N是显示几行.
javastr=""


<%
newstype=request("typeid")
if newstype=108 then
%>
javastr=javastr+""
<%
end if
n=request("n")

if newstype<> "" then
set rs=server.createobject("adodb.recordset")
sqltext="select * from Article where yes=1 order by dateandtime asc"
rs.open sqltext,conn,1,1

do while not rs.eof
fbtime=rs("dateandtime")
%>
javastr=javastr+"· <%if rs("selectpic") = 1 then%>[图文]<%end if%>&path=<%=rs("path")%>&filename=<%=rs("N_Fname")%>\") target=\"_blank\" ><%=rs("title")%> [<%=fbtime%>]
"
<%n=n-1
if n<1 then exit do
rs.movenext
loop
%>
<% if n<1 then %>
javastr=javastr+""
<% end if
if newstype=1 then
%>
javastr=javastr+"
"
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
document.write (javastr)
<%else%>
document.write ("对不起,暂时没有任何内容。")
<%end if%>
可是到最后确什么数据也没有显示,我是通过一个Jav程序用这个程序的,目的是显示数据库里的信息有谁能够帮我.



我佛山人

职务:版主
等级:4
金币:16.0
发贴:2269
注册:2002/8/7 15:09:27
#22003/7/1 20:53:44
确保代码完整?

你的最后输出好象是用JS,不过没看到你的ASP有输出