Basic Oracle Connection Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashwah
    New Member
    • Aug 2007
    • 15

    Basic Oracle Connection Question

    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.

    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
    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
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    The problem might be with the driver you are using. Try to use oracle driver.

    Comment

    Working...