0
votes

I am using Oracle 9i database. I created an account or cluser in ODBC data source administration. I used this data source username as a service in ODBC RDO in crystal report ASP.NET, but I got following error.

Failed to open the connection.

Details:08001:[Microsoft][ODBC driver for oracle][Oracle]ORA-12154:
TNS:could not resolve service name

How can I solve this problem? I want to connect Oracle 9i with ODBC in crystal report.

2
This probably means that the file TNSNAMES.ORA does not contain a valid entry for the server you referenced in the ODBC setup, However your statement 'I created a user ...' is a little confusing.Hugh Jones
Find the file tnsnames.ora firstHugh Jones
and after that what I do?user3843675
You need to create an entry in that file. You had best do a little googling as to what to do from that point on.Hugh Jones

2 Answers

0
votes

Create ODBC datasource in windows and pass it in ReportDocument.DataSourceConnections[0].SetConnection("DnsConnectionYouCreated","",true)

0
votes

I just ran into this error when trying to: ORA-12154: TNS:could not resolve service name on one of our development machines. We were using Crystal Designer, installed on the server directly and could not Log On to the server inside the designer. In ASP.NET we were getting Message: Database logon failed. Stack Trace: at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)

One confusing part was that other tools (e.g. PL SQL Developer, using a file called test.UDL and testing that) connected to the new and old instances fine and CR designer connected to older instances fine (but not the new instance).

Knowing that TNSNAMES.ORA contains references to these instances, we thought we had all TNSNAMES.ORA's correctly updated with the entry to the new instance, but alas, there were 4 TNSNAMES.ora files on this server and 2 were out of sync. Yeah, why do we have 4? Unsure, this is a dev box and things just get "weird"... so bottom line: do a search of the entire disk and make sure ALL of your TNSNAMES.ora files have the entry you are trying to connect to.