• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Failed to open connection error in Crystal Reports

I'm trying to view the sql for a report I created at another job.
The db at the old job was oracle, while at the new job its sql.

When I try to view the sql code, I get a "Failed to open connection ORA-12154" error.

Any suggestions how I can get around this?
0
metalteck
Asked:
metalteck
  • 8
  • 8
  • 3
  • +1
1 Solution
 
SimonCommented:
A while since I used Crystal - can't you open the report in design mode and avoid this?
Which version of Crystal?
0
 
metalteckAuthor Commented:
I'm trying to open it while in design mode and I'm using CR 2008.
0
 
SimonCommented:
The only clue I could find: Is the file marked as read-only when you view its properties in Windows Explorer?
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
vastoCommented:
Are the Oracle and SQL datbabases with the same structure ?
0
 
metalteckAuthor Commented:
The file was not read only. I changed it, but I still couldn't view the code. They are the same structure.
0
 
mlmccCommented:
You can't view the SQL unless you can connect to the database.

mlmcc
0
 
vastoCommented:
If the Oracle and SQLServer databases are with the same structure you can set the report to use the SQL database and then go and check SQL. To switch to the SQL database select menu Database-> Set Database location , create a new connection the SQLDatabase and update the existing connection to the new one
0
 
metalteckAuthor Commented:
I tried doing that, but get an Failed to retrieve data from database details 42000.
'SUBSTR' is not a recognized built in function name.

Any way I can get past this error?
0
 
mlmccCommented:
Is the report based on a command or tables?

mlmcc
0
 
metalteckAuthor Commented:
On a command.
0
 
vastoCommented:
SUBSTR in ORACLE  is probably equivalent of SUBSTRING in SQLServer. You need to update the Command SQLto SQLServer syntax. What is the purpose to get the SQL from  the repor6t if it is based on Command? You can get the Command SQL
0
 
metalteckAuthor Commented:
I need to duplicate the same report but instead of Oracle in SQL. I need to find out which tables I used and what logic I used. I'm not going to try and run that report, I just want to view the sql code.
0
 
vastoCommented:
Can you upload the report here ?
The command will show you the full SQL. If you don't have anything else ( other commands, tables etc.) the command should contain everything you need.
0
 
mlmccCommented:
You can't see the SQL of a command unless you have the database available

mlmcc
0
 
metalteckAuthor Commented:
Here is the rpt file
0
 
vastoCommented:
Sorry , I cannot see it. Is it attached ?
0
 
metalteckAuthor Commented:
0
 
vastoCommented:
SELECT  distinct
         WFWUQUEUE.WORKUNIT,
         WFWORKUNIT.WORK_TITLE,      
         SUBSTR(WFWORKUNIT.KEY_STRING,6) REQNUMBER,
         WFWORKUNIT.WF_RM_ID REQUESTER,
         WFWORKUNIT.WORK_CAT_VALUE,
         WFQUETASK.TASK,
         WFUSERCAT.WF_RM_ID APPROVER_ID,
         Z.FIRSTNAME,
         Z.LASTNAME
  FROM   LOGAN.WFWORKUNIT,
         LOGAN.WFWUQUEUE,
         LOGAN.WFQUETASK,
         LOGAN.WFUSERCAT,
         PROD.ZZWEBUSER Z
 WHERE       (WFWUQUEUE.WORKUNIT = WFQUETASK.WORKUNIT)
         AND (WFWUQUEUE.PROCESS_ID = WFQUETASK.PROCESS_ID)
         AND (WFWORKUNIT.WORKUNIT = WFWUQUEUE.WORKUNIT)
         AND (WFWUQUEUE.CATEGORY_VALUE = WFUSERCAT.WORK_CAT_VALUE)
         AND (WFQUETASK.TASK = WFUSERCAT.TASK)
         AND (WFQUETASK.R_STATUS = 1)  
         AND (Z.USERID = WFUSERCAT.WF_RM_ID)
         --and (WFWORKUNIT.WF_RM_ID = '&REQUESTER')
0
 
vastoCommented:
There is also a record selection formula

{Command.REQUESTER} = {?Requester Id}

I would suggest you to add a parameter inside the command and handle the filtering there
0
 
metalteckAuthor Commented:
Thanks so much. What did you do in order to view the code.
0
 
vastoCommented:
I used this tool: http://www.r-tag.com/Pages/CrystalSearch.aspx
It is documenting reports and showing the structure.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 8
  • 8
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now