Hi there. I'm trying to figure out how to populate my combo box with one of the fields returned from the ado data object that is created at runtime. The name of my combo box is cboPubrName. I'm including my code below. I would appreciate any help I can get with this. I tried just setting the datasource and datafield fields in the properties window of the combo object but it doesn't populate at run time. I'm somewhat new to VB when it comes to data access.
Dim adoConn As New ADODB.Connection
Dim adoRecordset As New ADODB.Recordset
Private Sub Form_Load()
With adoConn
.ConnectionString = "Provider=MSDAORA.1;Data Source=DATABEAST; Server=DATABEAST;User ID=-----;Password=-----;Persist Security Info=False"
.CursorLocation = adUseClient
.Open
End With
With adoRecordset
.ActiveConnection = adoConn
.CursorType = adOpenDynamic
.Open "Select a.descriptor, a.id from d2main.m_publisher a where exists (select 'X' from d2alllogs.r_pubr_rpt_log b where a.id=b.m_pubr_id)"
End With
cboPubrName.DataSource = adoConn
cboPubrName.DataField = a.descriptor
cboPubrName.AddItem = "ALL PUBLISHERS"
End Sub
Thanks in advance for the help.
CrystalVisualBOracle *:->*
Dim adoConn As New ADODB.Connection
Dim adoRecordset As New ADODB.Recordset
Private Sub Form_Load()
With adoConn
.ConnectionString = "Provider=MSDAORA.1;Data Source=DATABEAST; Server=DATABEAST;User ID=-----;Password=-----;Persist Security Info=False"
.CursorLocation = adUseClient
.Open
End With
With adoRecordset
.ActiveConnection = adoConn
.CursorType = adOpenDynamic
.Open "Select a.descriptor, a.id from d2main.m_publisher a where exists (select 'X' from d2alllogs.r_pubr_rpt_log b where a.id=b.m_pubr_id)"
End With
cboPubrName.DataSource = adoConn
cboPubrName.DataField = a.descriptor
cboPubrName.AddItem = "ALL PUBLISHERS"
End Sub
Thanks in advance for the help.
CrystalVisualBOracle *:->*