4
Contributors
5
Replies
7
Views
9 Years
Discussion Span
Last Post by Jx_Man
0

try this code :

Private Sub Form_Load()
Dim RS As ADODB.Recordset
    Dim Conn As ADODB.Connection
    Dim Comm As ADODB.Command
    Dim str As String
    
    Set Conn = New ADODB.Connection
    Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = D:\Only Me\Authors.mdb"
    Conn.Open
    Set Comm = New ADODB.Command
    Set Comm.ActiveConnection = Conn
    Comm.CommandText = "SELECT Au_ID FROM Authors"
    Comm.CommandType = adCmdText
    Set RS = Comm.Execute
    
    Do Until RS.EOF = True
        Combo1.AddItem RS!Au_ID
    RS.MoveNext
    Loop
     
    Set RS = Nothing
    Set Comm = Nothing
    Set Conn = Nothing
End Sub
0

Thanks JX_MAN, I will take that as a compliment. I wonder how many of those solved threads of yours are down to blatantly copying other members replies.
Whereas copying obviously works for some , others benefit from doing a little bit of thinking themselves!!
Hope the code helps with your problem Pranavdv.
Getting to grips with the ADO control is hard work but is a great tool once you get rolling.
Cheers for now

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.