I am using the following code to connect to my oracle DB. But getting the error "Runtime error :'-2147467259(80004005)':Automation error unspecified error" . The same code is working in my friends machine. I have Excel 2010 and Windows 7 OS. Please help me iam struggling with this since three days and just remembered about this thread and posting this. My last hope....
Private Sub CommandButton1_Click()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strCon As String
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
'---- Replace below names with the corresponding values
strCon = "Provider=OraOLEDB.Oracle;Data Source=DBname;User Id=UN;Password=PWD;"
con.ConnectionString = strCon
con.Open
'--- Now connection is open and you can use queries to execute them. It will be open till you close the connection
con.Close
End Sub
Vijayalakshmi