jocerakower
Programmer
jocerakower (Programmer) Nov 3, 2003
I've got 234 Crystal Reports v.9 which I'm trying to get VB6 to batch run overnight using a specific UID and password for each report - during the day these reports are used ad-hoc by users (and seem to remember the last user) - so I want to pass fresh UID and PWD for each report at run time using VB6 - there are several databases being used although each report is limited to using one database
I've been trying to use the LogOnServer method of the RDC (as recommended by Crystal Decisions) but to no avail (getting fault -2147189172) and the code I'm using is:
Sub Form_Load()
Dim App1 As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set App1 = CreateObject("CrystalRuntime.Application"
'XXX NEXT LINE IS WHERE IT ALWAYS FALLS OVER
App1.LogOnServer "p2smon.dll", "myDSNname", "myDatabase", "myname", "mypassword"
Set Report = App1.OpenReport("report.rpt"
Report.DiscardSavedData
Debug.Print App1.GetVersion
Report.Database.Verify
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Thanks for helping
I've got 234 Crystal Reports v.9 which I'm trying to get VB6 to batch run overnight using a specific UID and password for each report - during the day these reports are used ad-hoc by users (and seem to remember the last user) - so I want to pass fresh UID and PWD for each report at run time using VB6 - there are several databases being used although each report is limited to using one database
I've been trying to use the LogOnServer method of the RDC (as recommended by Crystal Decisions) but to no avail (getting fault -2147189172) and the code I'm using is:
Sub Form_Load()
Dim App1 As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set App1 = CreateObject("CrystalRuntime.Application"
'XXX NEXT LINE IS WHERE IT ALWAYS FALLS OVER
App1.LogOnServer "p2smon.dll", "myDSNname", "myDatabase", "myname", "mypassword"
Set Report = App1.OpenReport("report.rpt"
Report.DiscardSavedData
Debug.Print App1.GetVersion
Report.Database.Verify
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Thanks for helping