标题:[求助]高手求助~~~~~~~
只看楼主
风心
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2004-8-19
 问题点数:0 回复次数:5 
[求助]高手求助~~~~~~~

<% Dim cnn, rstArt, rstRe, sSQL, fso, fld, f, id, i, rstauser, rstruser Set cnn = Server.CreateObject("ADODB.Connection") Set rstArt = Server.CreateObject("ADODB.Recordset") Set rstRe = Server.CreateObject("ADODB.Recordset") set rstauser = server.createobject("adodb.recordset") set rstruser = server.createobject("adodb.recordset") Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fld = fso.GetFolder(Server.MapPath("./Images/pic/")) id = Request.QueryString("id") ' 打开到test数据库的连接 cnn.Open "DSN=data;" ' 在所选主题的浏览次数上加1 sSQL = "UPDATE articles SET view_times=view_times+1 WHERE art_id=" & id cnn.Execute sSQL, , adCmdText ' 创建原创帖子的记录集 sSQL = "SELECT * FROM articles WHERE id=" & id Set rstArt = cnn.Execute(sSQL, , adCmdText) ' 创建回复帖子的记录集 a = rstart("author") ssql = "select * from user where username = " & a set rstauser = cnn.execute(ssql, , adcmdtext) sSQL = "SELECT * FROM replies WHERE art_id=" & id & " ORDER BY reply_time DESC" Set rstRe = cnn.Execute(sSQL, , adCmdText) b = rstre("author") ssql = "select * from user where username = " & b set rstruser = cnn.execute(ssql, , adcmdtext) %>

在这一行set rstauser = cnn.execute(ssql, , adcmdtext) 出错

参数不足,期待是 1。

2004-12-28 11:56
tyang
Rank: 1
等 级:新手上路
帖 子:216
专家分:0
注 册:2004-9-16
得分:0 
最少要有一条记录呀

我的网站" target="_blank">http://www. 欢迎加入网站设计交流群:17222128
2004-12-28 12:55
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
得分:0 
ssql = "select * from user where username = " &amp; a
-&gt;
ssql = "select * from [user] where username = " &amp; a

天津网站建设 http://www./
2004-12-28 16:17
风心
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2004-8-19
得分:0 
我按版主这样做了,可是还是这样,出错

2004-12-28 18:39
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
得分:0 
ssql = "select * from [user] where username = " &amp; a
-&gt;
ssql = "select * from [user] where username ='" &amp; a &amp; "'"

天津网站建设 http://www./
2004-12-29 09:17
aniude
Rank: 2
等 级:新手上路
威 望:3
帖 子:231
专家分:0
注 册:2004-11-3
得分:0 
set rstauser = cnn.execute(ssql, , adcmdtext)
好象这个对象是没有用的,与本问题无关
但改成
改成cnn.execute(ssql)试试

2004-12-30 08:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-10196-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.089196 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved