Oracle DSN-less connection for linked table failing

elliotgr

Registered User.
Local time
Today, 19:27
Joined
Dec 30, 2010
Messages
67
I have two Oracle databases. One has a generic username and password, the other requires an individual userid and password.
The following code returns data from any database, so I know the connect string is correct.
Code:
Set strCon = CreateObject("ADODB.Connection")
 strConnection = "driver={Microsoft ODBC for Oracle};" & _
                    "server=MyOracleServerHere;uid=XXXX;pwd=XXXX;"
 
 Set db = OpenDatabase("MyOracleServerHere", , "driver={Microsoft ODBC for Oracle};server=MyOracleServer;uid=XXXX;pwd=XXXX;")
        strCon.ConnectionString = strConnection
    strCon.Open
     Set rs = strCon.Execute("Select * From MyTableHere")
    ' Show the first record description.
    MsgBox rs("DESCRIPTION")
    ' Close the connection.
    rs.Close
    strCon.Close

However when I try to create linked tables, the database with the generic userid and password creates the new linked table, while the other fails with error 3000. Is this an Oracle db setting to prevent userid and password being retained?
I think the DB_ATTACHSAVEPWD might be an issue with the database?


Code:
Set td = db.CreateTableDef(rst!Local_TableName, DB_ATTACHSAVEPWD, rst!Remote_TableName, rst!Connection_String)
            db.TableDefs.Append td
 

Users who are viewing this thread

Back
Top Bottom