Want to pass sql query to rystal report

Posted on 2002-03-27
Last Modified: 2010-05-02
I design a report on base of a three sql query using ado.
Now i want that the fields and design of report remain same but i pass a new query to the report because a field amount calculation vary on the base of the requirement.

How it is possible or any other way to solve the problem.
Question by:pak_slm
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
  • 4

Accepted Solution

dhanush earned 50 total points
ID: 6902369
If you are using ado for the crystal reports then you can pass the recordset created based on your query using "Setdatasource" method .

Dim cryRept As CRAXDRT.Report
cryrept.database.setdatasource <recordset>

Author Comment

ID: 6906452
i use three ado for report. how i can pass three different recordset for different ado

Author Comment

ID: 6906460
i need to change query because i change two fiels data and where condition each time i call report

Author Comment

ID: 6925013
please answer the question to solve my problem.

Author Comment

ID: 6952583
i use this code successfully

Dim cryRept As CRAXDRT.Report
cryrept.database.setdatasource <recordset>

one thing more if you can do favour

if is use this code second line as

then it require three parameter like data, data tag, tableNomber

what is meaning of these parameters. Can i use for more than one ado like
    Report.ParameterFields(1).AddCurrentValue HeadName

Please help me.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Determine Range to Select 5 64
VB6 - Convert HH:MM into Decimal 8 76
Spell Check in VB6 13 148
Set WorkSheet  not Working 9 62
Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

751 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