I am looking for a way to use the OraDatabase property of an Oracle ActiveX Control to initialize an OraDatabase object.
The "Using Oracle Objects for OLE with Automation Clients" manual has the following instructions for setting up the Oracle ActiveX Control:
I am working with an Access 2003 database connected to an Oracle 11g database. I have created a form and added an Oracle ActiveX Data Control (named 'OraDataControl') to it. I added the following code in VBA:
Private Sub SetOraDataControl(strSQL As String)
Dim dbo As OraDatabase
Dim strSQL As String
10 On Error GoTo ErrorHandler
20 With OraDataControl
30 .Connect = "+username/password+"
40 .DatabaseName = "+db-connection-string+"
50 .RecordSource = strSQL
70 Set dbo = .OraDatabase
80 End With 'With OraDataControl
90 On Error GoTo 0
100 Exit Sub
110 Debug.Print "Error: '" & Err.Description & "' (" & Err & ") at line " & Erl
120 Resume ExitSub
Obviously, in the actual code, I am using a valid username/password, db-connection-string, and SQL strings. The code run fine until it hits line 70, where I try to set an OraDatabase object to the .Oradatabase property of the control. I get the following error message:
Error: 'Object doesn't support this property or method' (438) at line 70
What would be the proper way to reference the OraDatabase property of the control?