在多选字段上使用Vbscript函数 [英] Using Vbscript function on Multi-select field

查看:68
本文介绍了在多选字段上使用Vbscript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用vbscript" split"功能多选

字段。我正在尝试

一次大量更新几个记录。

我收到错误,我不知道该怎么做。这是代码,如果


有人可以提供帮助...

strID = split(request.form(" proj"),"," )

projstat = split(request.form(" rojstat"),",")

impr = split(request.form(" impr")) ,")

idate = split(request.form(" rojinitdate"),",")

pdate = split(request.form (" plancompletedate"),",")

adate = split(request.form(" actualcompletedate"),",")


mdg = request.form(" mgr")

myArray3 =拆分(mdg," - ")

p = ubound(myArray3)
if mdg =" Not Assigned"然后

mdgg =" Not Assigned"

else

如果p = 1那么

mdgg = myArray3( 0)

其他

如果p = 2那么

mdgg = split((myArray3(0)&" *"&

mid(myArray3(1),6))," *")

else

如果p = 3则

mdgg = split((myArray3(0)&" *"&

mid(myArray3(1),6)&" *"&

mid(myArray3(2),6)),",")

else

如果p = 4那么

mdgg = split((myArray3(0)&" *"&

mid(myArray3(1),6)&" *"&

mid(myArray3(2),6)&" *"& mid(myArray3(3),6)),",")

else

如果p = 5那么

mdgg = split((myArray3(0)&" *"&

mid(myArray3) (1),6)&" *"&

mid(myArray3(2),6)&" *"& mid(myArray3(4),6) ),&q uot;,")

结束如果

结束如果

结束如果

结束如果

结束如果

结束如果

FOR i = LBound(strID)TO UBound(strID)

mySQL =" UPDATE Roj SET rojstatus =''" &安培;修剪(rojstat(i))& '',

importrank =''" &安培;修剪(impr(i))& "'',mgr =''" &安培;修剪(mdgg(i))& '',

rojinitdate =''" &安培;修剪(idate(i))& "'',plancompletedate =''" &

trim(pdate(i))& "'',actualcompletedate =''" &安培;修剪(adate(i))& ''


(refid =''"& strID(i)&"'')"

dbRroject.Execute (mySQL)

NEXT

这是我得到的错误

响应对象错误''ASP 0106:80020005''

类型不匹配

/project/DMMassUpdated.asp,第0行

遇到未处理的数据类型。

任何人都可以帮助?

I am trying to use the vbscript "split" function on a multi-select
field. I am trying
to do a mass update of several records at a time.
I am getting an error and I''m not sure what to do. Here is the code if

someone could help...
strID = split(request.form("proj"), ", ")
projstat = split(request.form("rojstat"),",")
impr = split(request.form("impr"),",")
idate = split(request.form("rojinitdate"),",")
pdate = split(request.form("plancompletedate"),",")
adate = split(request.form("actualcompletedate"),",")

mdg = request.form("mgr")
myArray3 = Split(mdg,"- ")
p = ubound(myArray3)
if mdg = "Not Assigned" Then
mdgg = "Not Assigned"
else
if p = 1 then
mdgg = myArray3(0)
else
if p = 2 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6)),"*")
else
if p = 3 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6) & "*" &
mid(myArray3(2),6)),",")
else
if p = 4 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6) & "*" &
mid(myArray3(2),6) & "*" & mid(myArray3(3),6)),",")
else
if p = 5 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6) & "*" &
mid(myArray3(2),6) & "*" & mid(myArray3(4),6)),",")
end if
end if
end if
end if
end if
end if
FOR i = LBound(strID) TO UBound(strID)
mySQL = "UPDATE Roj SET rojstatus= ''" & trim(rojstat(i)) & "'',
importrank= ''" & trim(impr(i)) & "'', mgr= ''" & trim(mdgg(i)) & "'',
rojinitdate= ''" & trim(idate(i)) & "'', plancompletedate= ''" &
trim(pdate(i)) & "'', actualcompletedate= ''" & trim(adate(i)) & "'' where

(refid =''" & strID(i) & "'')"
dbRroject.Execute(mySQL)
NEXT
This is the error I''m getting
Response object error ''ASP 0106 : 80020005''
Type Mismatch
/project/DMMassUpdated.asp, line 0
An unhandled data type was encountered.
Can anyone HELP?

推荐答案

pmarisole写道:
pmarisole wrote:
这是我得到的错误
响应对象错误''ASP 0106:80020005''
类型不匹配
/project/DMMassUpdated.asp,第0行
遇到未处理的数据类型。
This is the error I''m getting
Response object error ''ASP 0106 : 80020005''
Type Mismatch
/project/DMMassUpdated.asp, line 0
An unhandled data type was encountered.



从这里开始。
http://www.aspfaq.com/search.asp?q=80020005&x=10&y=10


如果这些文章不提供y我们的答案,让我们知道,我们将开始

挖掘您的代码。

-

Microsoft MVP - ASP / ASP .NET

请回复新闻组。我的From

标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。


Start here.
http://www.aspfaq.com/search.asp?q=80020005&x=10&y=10

If these articles don''t provide your answer, let us know and we''ll start
digging into your code.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don''t check it very often. You will get a
quicker response by posting to the newsgroup.




pmarisole写道:

pmarisole wrote:
我正在尝试使用vbscript" split"功能多选
字段。我正在尝试一次大量更新几个记录。
我收到错误,我不知道该怎么做。以下是代码,如果有人可以提供帮助......
strID = split(request.form(" proj"),",")
projstat = split (request.form(" rojstat"),",")
impr = split(request.form(" impr"),",")
idate = split(request) .form(" rojinitdate"),",")
pdate = split(request.form(" plancompletedate"),",")
adate = split(request.form (actualcompletedate),,,

mdg = request.form(" mgr")
myArray3 = Split(mdg," - ")
p = ubound(myArray3)

if mdg =" Not Assigned"那么
mdgg =" Not Assigned"

如果p = 1那么
mdgg = myArray3(0)
否则
如果p = 2那么
mdgg = split((myArray3(0)&" *"&
mid(myArray3(1),6))," *")
else
如果p = 3那么
mdgg = split((myArray3(0)&" *"&
mid(myArray3(1),6)&" *"& ;
mid(myArray3(2),6)),,,等等
如果p = 4那么
mdgg = split((myArray3(0)& ;" *"&
mid(myArray3(1),6)&" *"&
mid(myArray3(2),6)&" *" & mid(myArray3(3),6)),,,等等
如果p = 5那么
mdgg = split((myArray3(0)& " * QUOT; &
mid(myArray3(1),6)& " * QUOT; &
mid(myArray3(2),6)& " * QUOT; &安培; mid(myArray3(4),6)),,,
结束如果
结束如果结束如果
结束如果
结束如果
结束如果

FOR i = LBound(strID)TO UBound(strID)
mySQL =" UPDATE Roj SET rojstatus =''" &安培;修剪(rojstat(i))& "'',
importrank =''" &安培;修剪(impr(i))& "'',mgr =''" &安培;修剪(mdgg(i))& '',
rojinitdate =''" &安培;修剪(idate(i))& "'',plancompletedate =''" &
trim(pdate(i))& "'',actualcompletedate =''" &安培;修剪(adate(i))& "''

(refid =''"& strID(i)&"'')"
dbRroject.Execute(mySQL)
NEXT

这是我得到的错误
响应对象错误''ASP 0106:80020005''
类型不匹配
/project/DMMassUpdated.asp,line 0
遇到未处理的数据类型。

http://www.aspfaq.com/show.asp?id=2099


/ P.
任何人都可以帮忙吗?
I am trying to use the vbscript "split" function on a multi-select
field. I am trying
to do a mass update of several records at a time.
I am getting an error and I''m not sure what to do. Here is the code if

someone could help...
strID = split(request.form("proj"), ", ")
projstat = split(request.form("rojstat"),",")
impr = split(request.form("impr"),",")
idate = split(request.form("rojinitdate"),",")
pdate = split(request.form("plancompletedate"),",")
adate = split(request.form("actualcompletedate"),",")

mdg = request.form("mgr")
myArray3 = Split(mdg,"- ")
p = ubound(myArray3)
if mdg = "Not Assigned" Then
mdgg = "Not Assigned"
else
if p = 1 then
mdgg = myArray3(0)
else
if p = 2 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6)),"*")
else
if p = 3 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6) & "*" &
mid(myArray3(2),6)),",")
else
if p = 4 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6) & "*" &
mid(myArray3(2),6) & "*" & mid(myArray3(3),6)),",")
else
if p = 5 then
mdgg = split((myArray3(0) & "*" &
mid(myArray3(1),6) & "*" &
mid(myArray3(2),6) & "*" & mid(myArray3(4),6)),",")
end if
end if
end if
end if
end if
end if
FOR i = LBound(strID) TO UBound(strID)
mySQL = "UPDATE Roj SET rojstatus= ''" & trim(rojstat(i)) & "'',
importrank= ''" & trim(impr(i)) & "'', mgr= ''" & trim(mdgg(i)) & "'',
rojinitdate= ''" & trim(idate(i)) & "'', plancompletedate= ''" &
trim(pdate(i)) & "'', actualcompletedate= ''" & trim(adate(i)) & "'' where

(refid =''" & strID(i) & "'')"
dbRroject.Execute(mySQL)
NEXT
This is the error I''m getting
Response object error ''ASP 0106 : 80020005''
Type Mismatch
/project/DMMassUpdated.asp, line 0
An unhandled data type was encountered.

http://www.aspfaq.com/show.asp?id=2099

/P.
Can anyone HELP?






感谢您的输入。我修复了这个问题,但是现在我得到了两个列表框的值(用记录集中的所有值更新记录集中的

第一条记录)


字段选择值为:Jose Blewer - JLG我正在使用

SPLIT功能只选择''Jose Blewer''。

它正在更新第一个字段,其中包含从每个选择的所有值

成功记录。这几乎就好像它没有循环遍历

记录。

Thanks for the input. I fixed that problem but
now I am getting the values for both list boxes in one (updating the
first record in recordset with all values from every record)

The field selection values are: "Jose Blewer - JLG" and I am using the
SPLIT function to select only ''Jose Blewer'' .
It is updating the first field with all the values selected from every
succeeding record. It almost as if it is not looping through the
records.


这篇关于在多选字段上使用Vbscript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆