Hi there,
I have made a few bit of code in VBA in the past connecting to Access databases but this is my first attempt to connect to an Oracle DB. My code is as follows, and it seems to fall down at the point of populating the recordset. The equivalent code works fine using an Access connection, hence I'm a bit stumped.
I'm getting a useful 'unspecified error'. Please can anyone suggest anything? As for the error message, is there any way of getting a bit more useful info?
Cheers
Ashwah
I have made a few bit of code in VBA in the past connecting to Access databases but this is my first attempt to connect to an Oracle DB. My code is as follows, and it seems to fall down at the point of populating the recordset. The equivalent code works fine using an Access connection, hence I'm a bit stumped.
Code:
Public Sub oracleconnect()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
stringConnection = "Driver={Microsoft ODBC for Oracle};Server=MISSYSP;Uid=MISSYS;Pwd=******;"
stringSQL = "SELECT * FROM MISSYS.BWADDITIONALCOPY"
cn.Open stringConnection
rs.Open stringSQL, cn
cn.Close
Set cn = Nothing
Set rs = Nothing
End Sub
Cheers
Ashwah
Comment