循环嵌套,freefile可以这么写么?Private Sub CmdInport_Click()
Dim I, J As Integer
Dim Ls As String
Dim AdoConn As New ADODB.Connection
Dim AdoRst As New ADODB.Recordset
AdoConn.Open "Provider=MSDAORA.1;Password=pass;User ID=orcl;Data Source=oracle;Persist Security Info=True"
I = FreeFile
J = FreeFile + 1
Open "E:\work\mypath.ini" For Input As #I '打开配置文件循环
Do While Not EOF(1)
Input #1, a
Open a For Input As #J
Do While Not EOF(1) '程序循环
Input #J, Ls
'程序体
Loop
Loop
End Sub
Dim I, J As Integer
Dim Ls As String
Dim AdoConn As New ADODB.Connection
Dim AdoRst As New ADODB.Recordset
AdoConn.Open "Provider=MSDAORA.1;Password=pass;User ID=orcl;Data Source=oracle;Persist Security Info=True"
I = FreeFile
J = FreeFile + 1
Open "E:\work\mypath.ini" For Input As #I '打开配置文件循环
Do While Not EOF(1)
Input #1, a
Open a For Input As #J
Do While Not EOF(1) '程序循环
Input #J, Ls
'程序体
Loop
Loop
End Sub
J = FreeFile + 1
可以这么用么?
Do While Not EOF(1)
Input #1, a
Open a For Input As #2
Do While Not EOF(2) '程序循环
Input #J, Ls
'程序体
Loop
Close #2
Loop
Close #1