saving Crystal Report ADO connection string or ODBC connection details with report

I have a Crystal Reports 8.5 report.
My DB is MySQL.
When I try to open the report from a VB6 application I'm told my access is denied - no password.
I fill in the password in the ODBC driver DSN configuration form
(and all is good - I test the connection and it works fine) and hit OK and save the report, it doesn't seems to solve the problem.
I build an ADO connection string (my preferred way) but it doesn't seemed to be saved with the report either.
How do I save the ODBC connection details with the report or set it by code?

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.

If you're using the OCX (Crystal Report Control), use the Connect property:

With CrystalReport1
    .ReportFileName = "C:\YourReport.rpt"
    .Connect = "DSN=ODBC_DSN_Name;UID=Username;PWD=Password;DBQ=dbName"
    .Action = 1
End With

With the RDC (Report Designer Component) use the SetLogOnInfo method:

crxRpt.Database.Tables(1).SetLogOnInfo strServerOrDSNName, strDBNameOrPath, strUserID, strPassword


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
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
DB Reporting Tools

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.