Could not connect to Oracle database from excel macro

kirtesh250187

New Member
Joined
Jul 18, 2013
Messages
25
Hi,

Earlier i had a separate login credentials to access database. The macro used to work fine then.

Now my database access is LDAP authenticated (i.e my windows login id and pass is now my database login credentials). But now the below macro code is not working.

Error MSG "Runitime error '-2147217843(80040e4d)' invalid username/password; logon denied"

Could you please help me with this? I am using my windows login credentials here

Code:
Sub GetData()Dim rst As New ADODB.Recordset
Dim cnn As New ADODB.Connection
Dim tran_key
Dim strSql
Dim fname As String
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim strID, strPW As String
    strID = ThisWorkbook.Sheets("Input").Range("M3").Value
    strPW = ThisWorkbook.Sheets("Input").Range("M4").Value


b = 0
c = 0


conn = "UID=" & strID & ";PWD=" & strPW & ";DRIVER={Microsoft ODBC for Oracle};SERVER=prd.world;"
    With cnn
       .ConnectionString = conn
       .CursorLocation = adUseClient
       .Open
    End With

Thanks,
Kirtesh
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top