主题:  百思不得其解的command

victorfans

职务:普通成员
等级:2
金币:1.0
发贴:385
注册:2003/4/25 19:33:05
#12004/1/29 22:21:25
请高手帮我看看我这段代码是用dw-mx生成的,但是测试的时候是错误,高手帮我指点一下啊,错在哪? :confused:
-----------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/test.asp" -->
<%

if(request.querystring("id") <> "") then Command1__a = request.querystring("id")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_test_STRING
Command1.CommandText = "UPDATE data SET count=count+1 WHERE id=" + Replace(Command1__a, "'", "''") + ""
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<%
Dim Recordset1__a
Recordset1__a = "%"
If (request.querystring("id") <> "") Then
Recordset1__a = request.querystring("id")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_test_STRING
Recordset1.Source = "SELECT * FROM data WHERE id like '" + Replace(Recordset1__a, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<meta http-equiv="refresh" content="0;URL=show.asp">
</head>

<body>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>



victorfans

职务:普通成员
等级:2
金币:1.0
发贴:385
注册:2003/4/25 19:33:05
#22004/1/30 12:08:53
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/test.asp" -->
<%

if(Request.QueryString("id") <> "") then Command1__tt = Request.QueryString("id")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_test_STRING
Command1.CommandText = "UPDATE data SET count=count+1 WHERE id=" + Replace(Command1__tt, "'", "''") + ""
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<meta http-equiv="refresh" content="0;URL=show.asp">
</head>

<body>
</body>
</html>



victorfans

职务:普通成员
等级:2
金币:1.0
发贴:385
注册:2003/4/25 19:33:05
#32004/1/30 12:09:37
帮我看看啊



zdygh2009

职务:普通成员
等级:1
金币:0.0
发贴:66
注册:2003/1/30 9:17:49
#42004/2/5 9:35:44
你这是做更新数据还做什么??
Command1.CommandText = "UPDATE data SET count=count+1 WHERE id=" + Replace(Command1__a, "'", "''") + ""我从这个代码中看到是更新命令.UPDATE,但
是你没有说明清楚做什么用?
这个无法解释