vb shell 实时错误 53 文件未找到
PrivateSubCommand1_Click()'AdodcKeyFile.RecordSource="select*from[Key]wherewordId='"&...
Private Sub Command1_Click()
'AdodcKeyFile.RecordSource = "select * from [Key] where wordId='" & Text1.Text & "'"
'MsgBox "adodckeyfile" & AdodcKeyFile.RecordSource
'AdodcKeyFile.Refresh
Dim RARSourcePath As String
Dim RARTargetPath As String
Dim RARFileSource As String ' 从数据库中得到学生名和学生取得的试题号
Dim RARFileTarget As String '解压后的学生文件夹名
RARSourcePath = txt1.Text
RARTargetPath = txt2.Text
mystr = App.path & "\WinRAR.exe"
If Dir(mystr) = "" Then
If MsgBox("请把WinRAR.exe放入" & App.path, vbOKOnly + vbCritical) Then
Exit Sub
End If
End If
For i = 0 To AdodcRAR.Recordset.RecordCount - 1
RARFileSource = AdodcRAR.Recordset.Fields("stuid") & "-" & AdodcRAR.Recordset.Fields("wordid") & ".rar"
Source = RARSourcePath & "\" & RARFileSource
MsgBox "source:" & Source
'RARFileTarget = AdodcRAR.Recordset.Fields("stuid") & "-" & AdodcRAR.Recordset.Fields("wordid")
Target = RARTargetPath
MsgBox "Target:" & Target
mystr = mystr & " X " & " -o+ " & Chr(34) & Source & Chr(34) & " " & Chr(34) & Target & Chr(34)
'调用RAR文件解压缩
retval = Dir(Source)
If retval <> "" Then
' MsgBox "dir(source)" & Dir(Source)
MsgBox "mystr" & mystr
Shell mystr, vbHide
End If
Source = ""
Target = ""
mystr = ""
If MsgBox("下一个", vbOKCancel, "提示信息") Then
AdodcRAR.Recordset.MoveNext
End If
Next
End Sub
运行第一条记录的时候没有问题,但是到第二条记录的时候 就出现 实时错误‘53’ 文件未找到
retval = Shell(mystr, vbHide) 错误标记行
不知道为什么 ?请老师给指导
没有分数了 展开
'AdodcKeyFile.RecordSource = "select * from [Key] where wordId='" & Text1.Text & "'"
'MsgBox "adodckeyfile" & AdodcKeyFile.RecordSource
'AdodcKeyFile.Refresh
Dim RARSourcePath As String
Dim RARTargetPath As String
Dim RARFileSource As String ' 从数据库中得到学生名和学生取得的试题号
Dim RARFileTarget As String '解压后的学生文件夹名
RARSourcePath = txt1.Text
RARTargetPath = txt2.Text
mystr = App.path & "\WinRAR.exe"
If Dir(mystr) = "" Then
If MsgBox("请把WinRAR.exe放入" & App.path, vbOKOnly + vbCritical) Then
Exit Sub
End If
End If
For i = 0 To AdodcRAR.Recordset.RecordCount - 1
RARFileSource = AdodcRAR.Recordset.Fields("stuid") & "-" & AdodcRAR.Recordset.Fields("wordid") & ".rar"
Source = RARSourcePath & "\" & RARFileSource
MsgBox "source:" & Source
'RARFileTarget = AdodcRAR.Recordset.Fields("stuid") & "-" & AdodcRAR.Recordset.Fields("wordid")
Target = RARTargetPath
MsgBox "Target:" & Target
mystr = mystr & " X " & " -o+ " & Chr(34) & Source & Chr(34) & " " & Chr(34) & Target & Chr(34)
'调用RAR文件解压缩
retval = Dir(Source)
If retval <> "" Then
' MsgBox "dir(source)" & Dir(Source)
MsgBox "mystr" & mystr
Shell mystr, vbHide
End If
Source = ""
Target = ""
mystr = ""
If MsgBox("下一个", vbOKCancel, "提示信息") Then
AdodcRAR.Recordset.MoveNext
End If
Next
End Sub
运行第一条记录的时候没有问题,但是到第二条记录的时候 就出现 实时错误‘53’ 文件未找到
retval = Shell(mystr, vbHide) 错误标记行
不知道为什么 ?请老师给指导
没有分数了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询