| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
高端软件开发 = 年薪十万不是梦   
共有 262 人关注过本帖
标题:菜鸟求助
收藏  订阅  推荐  打印
本主题由 静夜思 于 2008-7-3 18:59 审核通过
hanwise
Rank: 1
等级:新手上路
帖子:1
积分:112
注册:2008-7-3
菜鸟求助

我们学校参加创新比赛我写的一个其中页面,主要思想是实现自助借车的网上预定的,这个页面是从上一个页面的表单中提取客户的预定借车时间和还车时间,从数据库中查询这个时间段空车的记录,这是其中一个页面代码,本人刚学ASP没几天,这个页面提示无法显示页面,是不是语法问题啊,高人指点:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
jieyue=request.Form("jieyue")
jieri=request.Form("jieri")
huanyue=request.Form("huanyue")
huanri=request.Form("huanri")
jietime=cdate(""&jieyue&" "&jieri&","&year(date))
huantime=cdate(""&huanyue&" "&huanri&","&year(date))
if jietime>huantime or (jietime<=huantime and jietime<date) then
    response.Write("你选择的时间不合逻辑,请返回重新选择!")
else%>
    <table border="1"  bordercolor="#FF0000" cellspacing="0">
    <tr>
    <td>条形码</td><td>站点</td><td>车型</td><td>预定</td>
    </tr>
    <%
    set bb=server.CreateObject("adodb.connection")
    connstr="provider=microsoft.jet.oledb.4.0;data source="& server.MapPath("自助交通.mdb")
    bb.open connstr
    set rs1=server.CreateObject("adodb.recordset")
    set rs2=server.CreateObject("adodb.recordset")
    
    rs1.open "select * from che where 借='false' and 车型='轿车'",1,1
    do while not rs1.eof
        rs2.open "select * from yudinghis where 车条形码='"&rs1("条形码")&"'",1,1
        yuding=false
        do while not rs2.eof
            if cdate("预定借车时间")<=huantime or cdate("预定还车时间")>=jietime or (cdate("预定借车时间")>=jietime and cdate("预定还车时间")<=huantime) then
                yuding=true
                exit do
            end if
            rs2.movenext
        loop
        rs2.close
        if yuding=false then
            <tr>
            <td>
            <%
            response.Write(rs1("条形码"))
            txm=rs1("条形码")
            %>
            </td>
            <td>
            <%
            response.Write(rs1("站点"))
            %>
            </td>
            <td>
            <%
            response.Write(rs1("车型"))
            %>
            </td>
            <td>
            <i><a href="yuding.asp?a=<%=rs1("条形码")%>&jtime=<%=jietime%>&htime=<%=huantime%>">预定</a></i>
            </td>
            </tr>
    </table>            
        <%end if
        rs1.movenext
    loop
    rs1.close
    set bb=nothing
    %><h1><%'response.Write("目前还有"&rs.recordcount&"辆轿车可借!")%></h1>
    
</p>
<p> </p>
</body>
</html>
2008-7-3 09:54
kgdipbyve
Rank: 2
等级:注册会员
帖子:92
积分:1082
注册:2008-5-4

你的数据库最好写成英文的...
2008-7-4 10:50
laser2008
Rank: 2
等级:注册会员
帖子:40
积分:516
注册:2008-4-7

最好先把数据库及字段名换成英文的,再试试!
2008-7-4 10:53
kgdipbyve
Rank: 2
等级:注册会员
帖子:92
积分:1082
注册:2008-5-4

把你的数据库表名发来看看
2008-7-4 11:09
kgdipbyve
Rank: 2
等级:注册会员
帖子:92
积分:1082
注册:2008-5-4

loop
    rs1.close
    set bb=nothing
********************************************
end if (你这里没有写)
//注意下,每次写远一句话对应结束下这个语句!
**********************************************   


%><h1><%'response.Write("目前还有"&rs.recordcount&"辆轿车可借!")%></h1>
   
</p>
2008-7-4 11:12
共有 261 人关注过本帖
发新话题
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.048853 second(s), 10 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved