This code is written assuming you are using Oracle and ADO to connect to database.
Dim Con as new ADODB.Connection
Dim Rs As New ADODB.Recordset
Con.ConnectionString = "Provider=OraOLEDB.Oracle.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=das"
If Con.State = 0 Then
Dim SQLName As String
SQLName = "SELECT NAME FROM ENGINEER"
Rs.Open SQLName, Con, adOpenDynamic, adLockOptimistic
Set CboName.DataSource = Rs
For i = 0 To Rs.RecordCount - 1
check out this sample code. this code intends to display all values of "name" field present in a table called "info" from an access database named "demo".
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path & "\demo.mdb")
Set rs = db.OpenRecordset("info", dbOpenTable)
Combo1.AddItem "<Select a Name>"
If rs.RecordCount > 0 Then
While Not rs.EOF()
MsgBox "No data present in the table."
Combo1.ListIndex = 0
here combo1 is the target control which is going to be filled up by the data of said column.
for ur consideration there is a screenshot below.check that out also.
for any more troubles u can meet me at firstname.lastname@example.org