关于付值和数组的问题

zhouguoguang 2008-03-20 01:02:20
Dim LieMing(5) As String
LieMing(0) = "XRD"
LieMing(1) = "DTA"
LieMing(2) = "RPZ"
LieMing(3) = "XWJ"
LieMing(4) = "TDL"
LieMing(5) = "SEM"
For i = 0 To 1

If Index = i Then

If DataCombo1.Text = "" Then
MsgBox "请选择送样编号", vbInformation, "系统提示"
DataCombo1.SetFocus
Exit Sub
End If

If Text9(i).Text = "" Then
MsgBox "请选择要上传的文件!"
Exit Sub
End If

OutPutFile = DataCombo1.Text & Label9(i).caption & ".doc"
FileCopy Text9(i).Text, "d:\" & OutPutFile & ""
'str = LieMing(i)

str2 = "update AllData set" & "lieming(i)" & "='d:\" & OutPutFile & "' where id ='" & DataCombo1.Text & "'"
Conn.Execute str2

MsgBox "文件上传成功!"
End If
Next

以上代码中数组LieMing(i)付不了值,使STR2返回的结果update AllData set lieming(i)='d:\" & OutPutFile & "' where id ='" & DataCombo1.Text & "'而不是update AllData set XRD'd:\" & OutPutFile & "' where id ='" & DataCombo1.Text & "'
为什么数组在STR2中付不了值
...全文
45 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
vbman2003 2008-03-20
str2 = "update AllData set " & lieming(i) & "='d:\" & OutPutFile & "' where id ='" & DataCombo1.Text & "'"
回复
相关推荐
发帖
VB基础类
创建于2007-09-28

7491

社区成员

VB 基础类
申请成为版主
帖子事件
创建了帖子
2008-03-20 01:02
社区公告
暂无公告