我做了一个asp循环,要把数据库里的题目循环出来,我是这样写的<%

来源:百度知道 编辑:UC知道 时间:2024/06/14 22:55:08
<%
Set Conn =Server.CreateObject("ADODB.Connection")
Conn.Open "DBQ=" & Server.MapPath("data/joke.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}"
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>title</title>
</head>

<body>
<table width="700" border="3" align="center" cellpadding="3" cellspacing="1" bordercolor="#FF0000">
<tr>
<%

SQL = "Select * From SMSTitle Where SMSTitle=" & SMSTitle
Set Rs = Conn.Execute(SQL)

<%Do While Rs.Eof=false%>
<%response.Write("SMSTitle")%>
<%rs.movenext

<%
'连接Access
dim conn
dim dbpath
dbpath=server.mappath("data/joke.mdb")
set conn=server.createobject("adodb.connection")
conn.open "Provider=Microsoft.Jet.Oledb.4.0;Data Source="&dbpath
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>title</title>
</head>

<body>
<table width="700" border="3" align="center" cellpadding="3" cellspacing="1" bordercolor="#FF0000">
<tr>
<td>
<%
SMSTitle="XXX"'定义值或是
SMSTitle=request("SMSTitle")'接收值
SQL = "Select * From SMSTitle Where SMSTitle='" & SMSTitle &"'"
Set Rs = Conn.Execute(SQL)
Do While not rs.eof
response.Write rs("SMSTitle")
rs.movenext