Hi there. I'm trying to figure out how to create an ADO object at runtime that will connect to our Oracle 8 database. I plan to use the records returned to populate a combo box on the form with one of the two fields returned in the ado recordset. I'm new to VB's data access methods but quite well versed in Oracle. Any help would be appreciated. I am including the code I have running so far but it keeps erroring out with an "end with or block variable not set " error at the bold line below. I would appreciate any help that could help me understand how the ado object works with an oracle database.
Thanks in advance,
CrystalVisualBOracle
Dim adoConn As ADODB.Connection
Dim adoRecordset As New ADODB.Recordset
Private Sub Form_Load()
With adoConn
.ConnectionString = "Provider=MSDAORA.1;User ID=d2secr;Data Source=DATABEAST;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 where exists (select 'X' from d2alllogs.r_pubr_rpt_log b where a.id=b.m_pubr_id)"
End With
End Sub
Note: I've not yet added the combo box that will be populated by the ado data object.
Thanks in advance,
CrystalVisualBOracle

Dim adoConn As ADODB.Connection
Dim adoRecordset As New ADODB.Recordset
Private Sub Form_Load()
With adoConn
.ConnectionString = "Provider=MSDAORA.1;User ID=d2secr;Data Source=DATABEAST;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 where exists (select 'X' from d2alllogs.r_pubr_rpt_log b where a.id=b.m_pubr_id)"
End With
End Sub
Note: I've not yet added the combo box that will be populated by the ado data object.