While Not Rs.EOF
    combobox.AddItem Trim$(Rs.Fields(0))
    Rs.MoveNext
Wend

解决方案 »

  1.   

    1、
    dim out as string
    Open "TESTFILE" For Output  read   As #1
    do until eof(#1)
    line input #1 ,nextline
    out=out+nextline+vbcrlf
    loop
    Close #1
      

  2.   

    dim out as string
    Open "TESTFILE" For INPUT  read   As #1
    do until eof(#1)
    line input #1 ,nextline
    out=out+nextline+vbcrlf
    combobox.AddItem OUT    
    loop
    Close #1
      

  3.   

    input read 不能用呀。提示出错。
      

  4.   

    Private Sub Form_Load()
    Dim out As String
    Dim pathname As String
    pathname = "d:\vbhelp.txt"
    Open pathname For Input As #1Do Until EOF(1)
    Line Input #1, nextline
    out = out + nextline + vbCrLf
    Combo1.AddItem out
    Loop
    Close #1
    End Sub
      

  5.   

    Private Sub Form_Load()
    Dim out As String
    Dim pathname As String
    pathname = "filename"  '你要打开的文件
    Open pathname For Input As #1Do Until EOF(1)
    Line Input #1, linetext
    Combo1.AddItem linetext
    Close #1
    End Sub
      

  6.   

    Private Sub Form_Load()
    Dim out As String
    Dim pathname As String
    pathname = "d:\vbhelp.txt"
    Open pathname For Input As #1Do Until EOF(1)
    Line Input #1, nextline
    out = nextline + vbCrLf
    Combo1.AddItem out
    Loop
    Close #1
    Combo1.ListIndex = 0End Sub
      

  7.   

    读入成功,但显示在combobox控件中不对。我想要的格式是
    1.第一条
    2.第二条
    3.第三条而上面语句显示出来却是:
    1.第一条
    1.第一条2.第二条
    1.第一条2.第二条3.第三条