Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

View Crystal Reports SQL Query

Posted on 2009-06-29
7
Medium Priority
?
824 Views
Last Modified: 2012-05-07
How can I display the SQL query that Crystal sends to the database when I run a report using the crystal reports viewer in VB.Net (visual studio 2005).  Basically I am looking for the runtime version of Show SQL Query feature in the designer.

thanks!
0
Comment
Question by:grossman52
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 17

Expert Comment

by:pssandhu
ID: 24739684
In Crystal Report, click on Database>Show SQL Query from the menu bar on top. I am using CR vs 10 as a standalone product and not using .NET to build reports. Hopefully the instructions will be the same in both the cases.
P.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24739997
if you start the profiler in SQL server, you will find the query that is received by SQL Server.
0
 
LVL 1

Author Comment

by:grossman52
ID: 24740297
Thanks for the response.  Unfortunately the database is not SQL Server but a flat file data structure accessed via ODBC.  Tried using the trace utility to spit out the SQL but did not produce the needed results.  Is there a property of the report that contains the SQL after it is constructed?  I did not see one but thought I would ask.
Thanks
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 17

Expert Comment

by:pssandhu
ID: 24740474
Not sure. The only way I know is what I posted above through Database?Show SQL Query. I know for a fact that it worls for Databases and Excel files.
P.
0
 
LVL 1

Author Comment

by:grossman52
ID: 24741158
Thanks for the suggestion but I need to see the information at run time.  I am running a report throguh a crystal viewer (passing in parms) and am not getting a row back.  I get a row back when I run the report from within crystal.  The generated SQL query must be incorrect but w/o being able to view it, I cannot diagnose the problem.

thanks
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24741632
The is a property for th eSQL QUery in the report object.

You might try displaying it in code.

With the VB6 API it is

crRptObj.SQLQuery

mlmcc
0
 
LVL 1

Accepted Solution

by:
grossman52 earned 0 total points
ID: 24745893
Thanks for the response but I am using VB.Net 2005.  I found  a way to display the SQL by using the ODBC Query Profiler option.  The SQL will get written to a file when you choose this option.  This should do the trick.

thanks
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question