open 文件名 for input as #1
line input #1,手机号码
close #1

解决方案 »

  1.   

    Open "C:\f.txt" For Inpuy As #fDo While Not EOF(f)
       Line Input #f,tel
    LoopClose #f
      

  2.   

    不好意思,刚才打错了一个字母
    Open "C:\f.txt" For Input As #fDo While Not EOF(f)
       Line Input #f,tel
    LoopClose #f
      

  3.   

    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, "系统提示"