我新建了一个数据库db1.mdb,里面有一张表tCount,表里有一个字段nCount,是数字型。现在默认有一条记录,内容是100.

我想用这个数据库作为记录访客的数据库。

每刷新一次网页,数据库里的100就加1.

但是现在出现一个问题。我看的教程里,他使用的是dw 8的,它用dw自带的数据库连接所产生的代码跟我用dw cs3/cs4产生的不相同。不知道cs3/cs4的代码里怎么改读写权限。dw 8的里面有一个语句是控制权限的。现在我这个生成的没有这些代码,加上去似乎也不行。

<% Recordset1.Fields.Item("nCount").Value=Recordset1.Fields.Item("nCount").Value+1
 Recordset1.update
 %>

这个就是用来操作数据库的。但是浏览网页后,显示错误。

错误类型:
ADODB.Field (0x800A0CB3)
当前记录集不支持更新。这可能是提供程序的限制,也可能是选定锁定类型的限制。
/index.asp, 第 44 行


它教程里也说过,可能是文件夹没有写入的权限,但是我已经改了,还是不行。

请问一下是怎么回事,要怎么改,谢谢。




----------------------------------------------

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/cnn.asp" -->

<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_cnn_STRING
Recordset1_cmd.CommandText = "SELECT nCount FROM tCount" 
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<form action="<%=MM_editAction%>" method="post" name="form1" id="form1">
  <table align="center">
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">NCount:</td>
      <td><input type="text" name="nCount" value="" size="32" /></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">编号:</td>
      <td><input type="text" name="Element" value="" size="32" /></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">&nbsp;</td>
      <td><input type="submit" value="插入记录" /></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="form1" />
</form>
<p>&nbsp;</p>
<!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=utf-8" />
<title>无标题文档</title>
</head>


<body>
<% Recordset1.Fields.Item("nCount").Value=Recordset1.Fields.Item("nCount").Value+1
 Recordset1.update
 %>
你是本站第<%=(Recordset1.Fields.Item("nCount").Value)%> 位访客!
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>