If your report is already set up to use an ODBC DSN, then you need to call the LogOnServer method. Using the sample you downloaded, the following is all of the necessary code to logon and preview a report from an ODBC data source in the Image40_Click() event ('Refresh Report'):
[tt]
Set crxReport = Nothing
Set crxReport = crxApplication.OpenReport(MyReportFile)
crxReport.Database.LogOnServer "p2sodbc.dll", "DSN_Name", "DB_Name", "UserID", "Password"
Me!CRViewer1.ReportSource = crxReport
Me!CRViewer1.ViewReport
[/tt]
The same code (minus the first line) would also go into the Image35_Click() event ('View').
To set parameters within the code as opposed to the Crystal parameter window:
[tt]
'Set a String parameter
crxReport.ParameterFields.GetItemByName("Country").AddCurrentValue "Argentina"
'Set a Date Range parameter
crxReport.ParameterFields.GetItemByName("DateRange").AddCurrentRange CDate("6/1/04"), CDate("6/29/04"), 3
[/tt]
-dave