Open "C:\f.txt" For Inpuy As #fDo While Not EOF(f) Line Input #f,tel LoopClose #f
不好意思,刚才打错了一个字母 Open "C:\f.txt" For Input As #fDo While Not EOF(f) Line Input #f,tel LoopClose #f
Dim tempSTR As String Dim objFile As Scripting.FileSystemObject Dim strText As TextStream Dim i As Integer
Set objFile = CreateObject("Scripting.FileSystemObject") Set strText = objFile.OpenTextFile(App.Path & "\DB_UpGrade.txt", ForReading) i = 1 While Not strText.AtEndOfStream tempSTR = strText.ReadLine MyCon.Execute tempSTR, , adCmdText Debug.Print i, tempSTR i = i + 1 Wend strText.Close Set strText = Nothing Set objFile = Nothing MsgBox "数据库升级完毕!", vbInformation + vbOKOnly, "系统提示"
Line Input #f,tel
LoopClose #f
Open "C:\f.txt" For Input As #fDo While Not EOF(f)
Line Input #f,tel
LoopClose #f
Dim objFile As Scripting.FileSystemObject
Dim strText As TextStream
Dim i As Integer
Set objFile = CreateObject("Scripting.FileSystemObject")
Set strText = objFile.OpenTextFile(App.Path & "\DB_UpGrade.txt", ForReading)
i = 1
While Not strText.AtEndOfStream
tempSTR = strText.ReadLine
MyCon.Execute tempSTR, , adCmdText
Debug.Print i, tempSTR
i = i + 1
Wend
strText.Close
Set strText = Nothing
Set objFile = Nothing
MsgBox "数据库升级完毕!", vbInformation + vbOKOnly, "系统提示"