写一个简单的函数

myveremy 2005-09-08 03:01:18
在同一个asp中要多次用到它,但是里面只是参数name不同。所以想写个函数
然后把参数传进去。

cmd="select * from table1 where id1='"+name+"'"
set rs1=conn.execute(cmd)
if not rs1.eof then
cmd="update table2 set isbool='F'where id1='"+name+"'"
conn.execute(cmd)
end if
...全文
55 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ShiningstarHu 2005-09-08
  • 打赏
  • 举报
回复
Private Sub theFunction(Byval name)

cmd="select * from table1 where id1='"+name+"'"
set rs1=conn.execute(cmd)
if not rs1.eof then
cmd="update table2 set isbool='F'where id1='"+name+"'"
conn.execute(cmd)
end if
End Sub

这样调用就可以了:
CALL theFunction("123")

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧