Hi I'm trying to connect to an oracle database using VBA code in EXCEL and it comes up with this error when I try to run the macro
[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve service name
I think the setting might be wrong also just in case this helps
Set cnOra = New ADODB.Connection
Set rsOra = New ADODB.Recordset
db_name = "test2"<-the actual name of the database is wxdb
UserName = "wworkstn"
Password = "change"
'Making an ODBC connection according to ADO
cnOra.Open "DSN=" + db_name + ";UID=" + UserName + ";PWD=" _
& Password + ";"
rsOra.CursorLocation = adUseServer
'Running a query
rsOra.Open "select global_name from global_name", cnOra, adOpenForwardOnly
so what settings do I need to use in the microsoft ODBC Data Source Administrator for either the user DSN or System DSN