Results 1 to 3 of 3

Thread: looping data from a Recordset into a combo box [Resolved]

Threaded View

  1. #1

    Thread Starter
    Addicted Member DKasler's Avatar
    Join Date
    Jan 2005
    Location
    Brooklyn, NYC
    Posts
    177

    Resolved looping data from a Recordset into a combo box [Resolved]

    I need to do a loop to take all the values in the Supplier column of the db table into the combo box.

    I tried doing it myself but somehow or another all I came up with was a record count. lol.

    Any help would be greatly appreciated. Thanks =)

    VB Code:
    1. Dim sconnect As String
    2.     Dim sSQL As String
    3.     Dim dfwConn As ADODB.Connection
    4.  
    5.     ' set strings
    6.     sconnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=M:\supplies\supplies.mdb;Persist Security Info=False"
    7.     sSQL = "select Supplier from Products ORDER by Supplier"
    8.     ' open connection
    9.     Set dfwConn = New ADODB.Connection
    10.     dfwConn.Open sconnect
    11.  
    12.     ' create a recordset using the provided collection
    13.     Set datPrimaryRs = New ADODB.Recordset
    14.     datPrimaryRs.CursorLocation = adUseClient
    15.     datPrimaryRs.Open sSQL, dfwConn, adOpenForwardOnly, adLockReadOnly
    Last edited by DKasler; Jun 7th, 2005 at 11:47 AM.
    -----MY SITES-----
    BayRidgeNights.Com - NYC Nightlife Forums

    Fight Communism - Rate Posts!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width