| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 464 人关注过本帖
标题:数据库更新问题 请指教
只看楼主 加入收藏
月夜
Rank: 1
等 级:新手上路
威 望:1
帖 子:90
专家分:0
注 册:2007-9-5
收藏
 问题点数:0 回复次数:7 
数据库更新问题 请指教
<!--#include file="conn.asp"-->
<%
Dim tpbts,tpfls,tpxxs,user1,id
tpbts=request.Form("tpbt")
tpfls=request.Form("tpfl")
tpxxs=request.Form("tpxx")
If session("users")<>"" Then
user1=session("users")
Else
user1="guest"
End If
Call openDB()
sql="select top 1 * from img order by id desc"
rs.open sql,conn,1,1
id=rs("id")
sql="update img set bt='"&tpbts&"',fl='"&tpfls&"',js='"&tpxxs&"',user='"&user1&"' where "&id&")"
conn.Execute(sql)
Call closeDB()
%>

提示错误
___________________________________________________________________________
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 多余的 ) 在查询表达式 '36)' 中。
/xc/tpxx.asp, 第 17 行
搜索更多相关主题的帖子: 指教 数据库 
2007-09-05 11:39
月夜
Rank: 1
等 级:新手上路
威 望:1
帖 子:90
专家分:0
注 册:2007-9-5
收藏
得分:0 
有兄弟帮忙么 - -!

自己写整站 累死个王八蛋
2007-09-05 11:44
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
sql="update img set bt='"&tpbts&"',fl='"&tpfls&"',js='"&tpxxs&"',user='"&user1&"' where "&id&")"

很明显的错误,有这样查询的吗?

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-09-05 11:46
月夜
Rank: 1
等 级:新手上路
威 望:1
帖 子:90
专家分:0
注 册:2007-9-5
收藏
得分:0 
-啊哦 ASP初学者 请指教该如何改正

自己写整站 累死个王八蛋
2007-09-05 11:49
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
sql="update img set bt='"&tpbts&"',fl='"&tpfls&"',js='"&tpxxs&"',user='"&user1&"' where &id&")"

改成

sql="update img set bt='"&tpbts&"',fl='"&tpfls&"',js='"&tpxxs&"',user='"&user1&"' where id="&id

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-09-05 11:51
steven1013
Rank: 2
等 级:论坛游民
帖 子:132
专家分:20
注 册:2007-8-11
收藏
得分:0 
换成这个试试
sql="update img set bt='"&tpbts&"',fl='"&tpfls&"',js='"&tpxxs&"',user='"&user1&"' where id='"&id&"'"

2007-09-05 12:07
lecojason
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2007-9-5
收藏
得分:0 

不用SQL=, 直接用conn.execute"update img set bt='"&tpbts&"',fl='"&tpfls&"',js='"&tpxxs&"',user='"&user1&"' where id="&id
快一点.

2007-09-05 12:24
flynet
Rank: 3Rank: 3
来 自:北京
等 级:论坛游民
威 望:7
帖 子:352
专家分:60
注 册:2007-1-28
收藏
得分:0 
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from img where id="&ID,conn,3,3
rs("bt")=tpbts
rs("fl")=tpfls
rs("js")=tpxxs
rs("user")=user1
rs.update()

PHP 新人 不断学习进取中。。。
2007-09-05 13:34
快速回复:数据库更新问题 请指教
数据加载中...
 
   



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

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