Send a dynamic SQL Statement to CR 8.5 From VB

hi

i need to send a sql statement to a crystal report from vb at runtime. i am using crystal report control (OCX & not the viewer)

Kalihto
kalihtoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hmadhurCommented:
How have you generated the RPT file? Have you used SQL/ODBC option or Active Data?

If you have used Active Data there is a better option of assigning a recordset directly to the report (Which is better)
0
hmadhurCommented:
You can use the SQL Query property of the ActiveX Control. I dont have CR 8.5. I am working on CR 7.

But beware, you should not change the columns in the select statements. For eg. your report extracts the Employee Code and Employee Name from Employee Table then your select statement should be

Select EmpCode, EmpName from Employee **where -----

You can only change the part after **. The SQL statement should remain unchanged.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hmadhurCommented:
You can use the SQL Query property of the ActiveX Control. I dont have CR 8.5. I am working on CR 7.

But beware, you should not change the columns in the select statements. For eg. your report extracts the Employee Code and Employee Name from Employee Table then your select statement should be

Select EmpCode, EmpName from Employee **where -----

You can only change the part after **. The SQL statement should remain unchanged.

Hope this helps.

Good Luck

If you have any more qs or things to clarify you can ask

Madhur
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

CleanupPingCommented:
Hi kalihto,
This old question (QID 20554360) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
GPrentice00Commented:
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I would appreciate any comments by the experts that would help me in making a recommendation.
It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

GPrentice00
Cleanup Volunteer
0
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept hmadhur's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.