Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2007, 08:48 PM
dorjvar dorjvar is offline
Member
 
Join Date: May 2005
Posts: 38
Default change sql.query of crystal Reports inside delphi project

Hi Dear Friends
My project is with delphi7 and Sql2000
I made a report with crystal reports 11 in my project
Connect my sql database to crystal report 11 via ado(in crystall)
in my report made a command and a crosstab

Now I want change all my sql.query of crystall before call report from delphi (change all sql.query)
sending parameters dont answer my problem
because I want change sql.query complete
(I make some temp table in project and want change my query by join with them)
How ?????????
Thanks
Reply With Quote
  #2  
Old 02-18-2007, 02:45 AM
jdg jdg is offline
Senior Member
 
Join Date: Sep 2003
Posts: 1,063
Default RE: change sql.query of crystal Reports inside delphi project

sending parameters dont answer my problem
because I want change sql.query complete


Would it be possible to change the sql in the same location as you have might have attempted to change the parameter values? Something along the order of:

[DELPHI]myQry.close;
with myQry do begin
unprepare;
with SQL do begin
clear;
// hopefully it's obvious that the following "add" lines
// would have to be modified to suit your need.
Add('SELECT A.field1, B.field2, ...');
Add('FROM table1 A, table2 B, ...');
Add('JOIN table3 C');
Add(' ON C.Field9 = A.field1')
Add('WHERE A.field1 = :SomeParam');
end;
ParamByName('SomeParam').DataType := ftInteger; // or other type
ParamByName('SomeParam').ParamType := ptInput;
ParamByName('SomeParam').Value := // some value
prepare;
end;
myQry.open;[/DELPHI]

jdg.ho

I love this forum. Your generosity is wonderful.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 06:02 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.