Dim rpt As New ReportDocument()
rpt.Load(Server.MapPath("../Rpt/myReport.rpt"))
Dim crtableLogoninfo As New TableLogOnInfo()
Dim crConnectionInfo As New ConnectionInfo()
Dim CrTables As Tables
Dim db = YourClass.GetDatabaseConnection()
crConnectionInfo.ServerName = db.HOST
crConnectionInfo.DatabaseName = db.DBNAME
crConnectionInfo.UserID = db.UID
crConnectionInfo.Password = db.UPWD
CrTables = rpt.Database.Tables
For Each CrTable As CrystalDecisions.CrystalReports.Engine.Table In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
rpt.SetParameterValue("pCustomerID", strCustomerID)
rpt.RecordSelectionFormula = "Formula"
Me.rptCrystal.ReportSource = rpt