Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to create runtime ADO connection to Oracle 8 Database in VB6

Status
Not open for further replies.
Joined
Jan 8, 2001
Messages
163
Location
US
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.
 
Fout: Dim adoConn As ADODB.Connection

= Dim adoConn As New ADODB.Connection
Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
 
Thanks. Missed that one. Simple but an easy mistake to make when you're at work on Saturday afternoon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top