acessing from database

how to get the all records of particular field in the database in combobox in the application

Comments

  • : how to get the all records of particular field in the database in combobox in the application
    :
    Try something like this (If using VB6):

    [code]
    Dim n As Integer

    ADO.Refresh
    For n=0 To ADO.Recordset.RecordCount - 1
    Combo1.AddItem ADO.Recordset("NameOfYourField").Value
    ADO.Recordset.MoveNext
    Next n

    [/code]

    Hope this helps!
  • I want to ask if where can I put this code? Can I declare it before loading the form?

    : : how to get the all records of particular field in the database in combobox in the application
    : :
    : Try something like this (If using VB6):
    :
    : [code]
    : Dim n As Integer
    :
    : ADO.Refresh
    : For n=0 To ADO.Recordset.RecordCount - 1
    : Combo1.AddItem ADO.Recordset("NameOfYourField").Value
    : ADO.Recordset.MoveNext
    : Next n
    :
    : [/code]
    :
    : Hope this helps!
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories