Add Data from Access to Combo Box

Reply

Join Date: Mar 2007
Posts: 24
Reputation: pranavdv is an unknown quantity at this point 
Solved Threads: 0
pranavdv pranavdv is offline Offline
Newbie Poster

Add Data from Access to Combo Box

 
0
  #1
Apr 17th, 2008
please help that how to add data of one field of database to the combo box.

i attached one rar file with this. check that
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 51
Reputation: lostandfound is an unknown quantity at this point 
Solved Threads: 1
lostandfound's Avatar
lostandfound lostandfound is offline Offline
Junior Poster in Training

Re: Add Data from Access to Combo Box

 
0
  #2
Apr 17th, 2008
Ther are 10 types of people in the world. Those who do understand binary and those who don't!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: Add Data from Access to Combo Box

 
0
  #3
Apr 17th, 2008
hi pranavdv...
where is your attachment?
Rar file is not supported in this forum, use zip file.
Last edited by november_pooh; Apr 17th, 2008 at 8:46 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,650
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 249
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Add Data from Access to Combo Box

 
0
  #4
Apr 17th, 2008
try this code :
  1. Private Sub Form_Load()
  2. Dim RS As ADODB.Recordset
  3. Dim Conn As ADODB.Connection
  4. Dim Comm As ADODB.Command
  5. Dim str As String
  6.  
  7. Set Conn = New ADODB.Connection
  8. Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = D:\Only Me\Authors.mdb"
  9. Conn.Open
  10. Set Comm = New ADODB.Command
  11. Set Comm.ActiveConnection = Conn
  12. Comm.CommandText = "SELECT Au_ID FROM Authors"
  13. Comm.CommandType = adCmdText
  14. Set RS = Comm.Execute
  15.  
  16. Do Until RS.EOF = True
  17. Combo1.AddItem RS!Au_ID
  18. RS.MoveNext
  19. Loop
  20.  
  21. Set RS = Nothing
  22. Set Comm = Nothing
  23. Set Conn = Nothing
  24. End Sub
Last edited by Jx_Man; Apr 17th, 2008 at 10:05 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 51
Reputation: lostandfound is an unknown quantity at this point 
Solved Threads: 1
lostandfound's Avatar
lostandfound lostandfound is offline Offline
Junior Poster in Training

Re: Add Data from Access to Combo Box

 
0
  #5
Apr 18th, 2008
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
Ther are 10 types of people in the world. Those who do understand binary and those who don't!!
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,650
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 249
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Add Data from Access to Combo Box

 
0
  #6
Apr 18th, 2008
??
hmm...sorry if this code some like yours...
well, i have a book for this.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 3472 | Replies: 5
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC