我用下面的代码为什么保存的“学费”总是0?

hgllucky 2003-12-12 03:57:00
dim array2()
i=0
Set conn88=Server.CreateObject("ADODB.Connection")
conn88.Open "Driver=SQL Server;Server=192.168.0.63;UID=hgx;PWD=hgx;Database=rlzy"
Set myrst88=Server.CreateObject("ADODB.Recordset")
sql88="select * from 培训记录表 where 课程名称 like '%" & kcmc & "%'"
sql88=sql88 & "and 时间='" & date1 & "' and 截止时间='" & date2 & "' and 所在公司='" & gs & "'"
myrst88.open sql88,conn88,3,3
do while not myrst88.eof
redim array2(i)
response.write array2(i)
sql ="update 培训记录表 set 学费='" & array2(i) & "' where 编号='" & myrst88("编号") & "'"
conn88.execute(sql)
i=i+1
myrst88.movenext
loop
myrst88.close
set myrst88=nothing
conn88.close
set conn88=nothing
...全文
45 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
考,又一个倒分的!!!
hgxlucky 2003-12-12
  • 打赏
  • 举报
回复
既然学费都一样,直接update 不就行了?
61 2003-12-12
  • 打赏
  • 举报
回复
Redim array2(I-1)
  • 打赏
  • 举报
回复
dim array2
array2=split(xf,", ") '数组类型

for i=0 to ubound(array2)
Redim Preserve array2(i)
sql ="update 培训记录表 set 学费='" & array2(i) & "' where 编号='" & myrst88("编号") & "'"
angelheavens 2003-12-12
  • 打赏
  • 举报
回复
Dim array2()
Dim I
'...
myrst88.open sql88,conn88,1,1
I=myrst88.RecordCount
If I<=0 Then Response.end
Redim array2(I-1)
'...
hgllucky 2003-12-12
  • 打赏
  • 举报
回复
array2=split(xf,", ")
xf是通过其他程序算出来的,xf输出也正确,然后我把xf通过split函数付给array2,不知为什么,系统总是提示“类型不匹配”
swich 2003-12-12
  • 打赏
  • 举报
回复
redim array2(i)没什么用嘛

array2(i)=学费金额
hgllucky 2003-12-12
  • 打赏
  • 举报
回复
array2=split(xf,", ")
我这样赋值,系统总是提示“类型不匹配”
iamsangster 2003-12-12
  • 打赏
  • 举报
回复
redim array2(i)
response.write array2(i)
初始化没有?
angelheavens 2003-12-12
  • 打赏
  • 举报
回复
array2(i)没有赋值

28,391

社区成员

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

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