Solved

Crystal report in SQL

Posted on 1998-08-05
3
137 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now