Solved

Crystal report in SQL

Posted on 1998-08-05
3
143 Views
Last Modified: 2010-05-03
i would like to print out the report according to the query below, the table name is "table", field is "id" and search for the word "test", if found then print out the report. but i've tried the following code it printed out all the report. why ?

CrystalReport1.SQLQuery = "SELECT * FROM table WHERE id = 'test'"
0
Comment
Question by:qazwsxedc
[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
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
percosolator earned 10 total points
ID: 1467967
If you are still attaching to Access like in your last question, it won't work.  SQLQuery is for attaching to a SQL Server.

One alternative is to create a stored Access query with a parameter field to pass in.


0
 

Author Comment

by:qazwsxedc
ID: 1467968
you meant SQLquery just for SQLserver usage ? if then how the alternative ways work that you talking about ?
0
 
LVL 2

Expert Comment

by:percosolator
ID: 1467969
don't know if it's only MS SQL server, probably not, more than likely it will work with another SQL server, Oracle or some other.

If you know how to create an Access query, you can do several things:  create the query to show all of the critical fields and attach Crystal to that query, and then pass a filter to crystal using the filter property like I showed you in the other question (which is probably your best route, since it's simplest)

Or create a temporary table in Access, create two action queries (one to delete all records in the table, and the other to populate the table with your desired data by passing a parameter to it) and linking crystal to that temporary table.  This method is more involved and has more steps, but is quicker to generate the report and depends on what, exacltly you are doing, how many stages the data has to go through, and (of course) how many records you are dealing with.

If you aren't talking 1000's of records, or your data doesn't have to be staged, or transformed, then I would recommend the first method.

P.S.  How do you pronounce "qazwsxedc"?  Thought mine was bad <g>.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

615 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