易截截图软件、单文件、免安装、纯绿色、仅160KB

asp一个SQL操作的问题,更新字段时用字段本身

请看一下我要实现这个效果,应该如何处理呢?
conn.execute("update table set ziduan="&chengxu(ziduan,bianliang)&" where id=1")

就是说,我要更新的是“ziduan”这个字段,而“chengxu(参数1,参数2)”又是一个asp过程(用当前的内容加上新的内容),都是字符型数据,有没有办法实现呢?
Function chengxu(c1,c2)
c3=c1&c2
chengxu=c3
End function
bianliang="1,2,3"

aaa=chengxu(ziduan,bianliang)
这样来代替

好像不能这么干的吧

strsql="select zhiduan from table where id=1"
set rs = dbconn.execute(strsql)
if not(rs.eof and rs.bof) then
strsql="update table set ziduan="&chengxu(rs("zhiduan"),bianliang)&" where id=1"
end if

少写了这一句
dbconn.execute strsql

用3楼的方法实际上是进行了一次查询和一次更新,我主要是想实现直接更新的操作,不知道有没有办法。

这样是不行的吧!
你先把chengxu(ziduan,bianliang)赋给一个变量!

顺便再请教一下
rs=server.createobject("adodb.recordset")
sql="select * from table"
rs.open conn,1,1
do while not rs.eof
rs1=server.createobject("adodb.recordset")
sql1="select * from table2 where id="&rs(id)&""
if rs1.eof then
conn.execute("update table set......")
else
end if
rs1.close
set rs1=nothing
rs.movenext


相关问答:

Asp+sql server问题 - Web 开发 / ASP

我一个项目,有个插入操作,具体是这样的:
我有进货信息表。在出货时选择相应的进货信息,输入数量,选择部门后,点保存按钮,由于网络延时,点一下没有反映,于是用户就又点一下,导致一次插入了两条记录:
例: ......

求一sql语句 - MS-SQL Server / 疑难问题

现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......

asp初学问题 - Web 开发 / ASP

Microsoft JET Database Engine '80040e07' 
标准表达式中数据类型不匹配。 
\wwwroot\update.asp, line 20
--------------------------------------------------------------------------------
Ho ......

ASP 。NET如何选择 - Web 开发 / ASP

大家好!我是一个学生,现在是学ASP的不知道怎么回事,我自己是用CMS做过网站 代码也能看懂一点 现在想买本书,想法有很多,就是想买ASP的 又看到大家说ASP以后没有NET前景好,我又想再去买本ASP.NET的 我知道有这样的想法 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号