ASP的问题,应该不难...
<!--#include file="adovbs.inc"-->
<%dim Conn,RS
dim strSQL
dim MusicID, MusicName, MusicLevel, MusicStars
%>
<head>
<title>测试页面</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>
<body bgcolor="#ffffff">
<%
set Conn=server.createobject("adodb.connection")
Conn.Open "Mydata"
set RS=server.createobject("adodb.recordset")
%>
<table width="700" border="0" cellspacing="0" cellpadding="0">
<%
strSQL="select filmID,name,level,stars from films"
RS.Open strSQL, Conn, adOpenForwardOnly, adLockReadOnly '这一行
While Not RS.EOF
MusicID=RS.fields("filmID").Value
MusicName=RS.fields("name").Value
MusicLevel=RS.fields("level").Value
MusicStars=RS.fields("stars").Value
%><tr>
<td height="21" width="45">
<a href="filmlist.asp?ID=<%=MusicID %>" ><%=MusicName%></a>
</td>
<td height="21" width="45">
<%=MusicLevel %>
</td>
<td height="21" width="45">
<%=MusicStars %>
</td>
</tr>
<%
RS.MoveNext
Wend
RS.Close
Conn.close
%>
</table>
</body>
测试的时候,错误如下:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] LEVEL 子句中包含一个保留字、拼写错误或丢失的参数,或标点符号不正确。
/db/test.asp, 第 23 行(在上面已作标记)
我查了一下recordset的open方法的用法,好像是这么用的,但它为什么总是抱错呢?
小弟初学,大家帮忙了