cybeh
asked on
How to include Param in the SubReport SQL connection via VB?
Hi,
I need to set a new data source for my Crystal Report Subreport. But, in the SQL string, it's something like this
SELECT * FROM tblRelationship WHERE ClientID = {?MainClientID}
Where {?MainClientID} is a param that pass value from the Main Report.
And during VB runtime, we need to change the database connection
rs_main.Open strsql2, DB_CONN, adOpenStatic, adLockReadOnly
rs_sub1.Open strSql, DB_CONN, adOpenStatic, adLockReadOnly
m_report.Subreport1.OpenSu breport.Da tabase.Set DataSource rs_sub1
m_report.Database.SetDataS ource rs_main
So, now the problem come from, I can't directly set the SQL String to the mySQL as they will not accept {?MainClientID} . May I know how can I solve this?
I need to set a new data source for my Crystal Report Subreport. But, in the SQL string, it's something like this
SELECT * FROM tblRelationship WHERE ClientID = {?MainClientID}
Where {?MainClientID} is a param that pass value from the Main Report.
And during VB runtime, we need to change the database connection
rs_main.Open strsql2, DB_CONN, adOpenStatic, adLockReadOnly
rs_sub1.Open strSql, DB_CONN, adOpenStatic, adLockReadOnly
m_report.Subreport1.OpenSu
m_report.Database.SetDataS
So, now the problem come from, I can't directly set the SQL String to the mySQL as they will not accept {?MainClientID} . May I know how can I solve this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found the solution, Thanks.
Glad i could help
mlmcc
mlmcc
ASKER
As I see I only have the option of "is equal to" or something like that.