主题:  请高手指点一下!先谢了!

chenhuizcl

职务:普通成员
等级:1
金币:0.0
发贴:25
注册:2002/1/15 10:48:41
#12002/1/16 22:31:57
我做了一个论坛在网上测试时,出现如下提示:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

/a/udadd.asp, 行90

我可以用本地站里注册的用户(原来的mdb文件里有的user,用username与password登陆,但是要留言时就出现如上的提示,好象是可以读取数据库的数据,但是不能在网上写入。
原码如下:请大侠们指点一下,小弟先谢了!

<%@LANGUAGE="VBSCRIPT"%>

<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) <> "") Then

MM_editConnection = MM_ok_STRING
MM_editTable = "book"
MM_editRedirectUrl = "udlist.asp"
MM_fieldsStr = "name|value|homepage|value|email|value|subject|value|content|value|radiobutton|value|ip|value|hot|value|site|value|sex1|value|head1|value"
MM_columnsStr = "name|',none,''|homepage|',none,''|email|',none,''|subject|',none,''|content|',none,''|face|none,none,NULL|ip|',none,''|hot|none,none,NULL|site|',none,''|sex|none,none,NULL|head|none,none,NULL"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request("MM_insert")) <> "") Then

' create the sql insert statement
MM_tablevalues = ""
MM_dbvalues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tablevalues = MM_tablevalues & ","
MM_dbvalues = MM_dbvalues & ","
End if
MM_tablevalues = MM_tablevalues & MM_columns(i)
MM_dbvalues = MM_dbvalues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tablevalues & ") values (" & MM_dbvalues & ")"

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>
<%
Dim rs__sname
rs__sname = "xyz"
if (Session("MM_Username") <> "") then rs__sname = Session("MM_Username")
%>
<%
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_ok_STRING
rs.Source = "SELECT * FROM userinfo WHERE name='" + Replace(rs__sname, "'", "''") + "'"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
%>


udadd































































姓名


">

性别


.gif" width="32" height="32">


头像

.gif" width="32" height="32">

主页


">

邮箱


">

IP地址


">

主题




内容




请选择表情图标:

















































 



">



">
">




CopyRight_2001, All Rights Reserved



广西北海天湖酒店有限责任公司 设计制作

版权所有© 广西北海天湖酒店IT事业部

通信地址:广西北海市侨港银滩之滨

电话:0779-3888779-2020

传真:0779-3881679



<%
rs.Close()
%>



5D公害

职务:普通成员
等级:9
金币:10.3
发贴:36272
注册:2002/1/13 9:52:57