
Subreport: cannot/don't know how to refresh subreport dbname thru VB Code
Environment
==========
I have a CRW6 report with 2 sub-report that retrieves data
from SQL server 6.5. The report is running as a .rpt file
and is triggered by a
Visual Basic exe.
Symptom
=======
The report produces error stating that dbname.table.field
not found when the sub-report is present because the
dbname not longer exist on the client site.
Problem Description
================
If we are going to run a report that is developed under
another database (different name but identical structure)
such as one for unit test, one for UAT and one for
production, I have to refresh the connect property thru
the Visual Basic code before running it. This approach
works fine for those without sub-report.
Investigation Made
===============
1. Delete sub-report from the problem report
No more errors. It looks like that the sub-report is not
refreshed.
2. Check connection info
I have downloaded a update60.exe in crystal decision site
that allow me to change the connection info such as db
name without the Crystal Report designer. Its seems that
CRW has extracted the dbname info from my DSN and put it
into the rpt itself. Not improvement if I change the
dbname thru the utility.
N.B. the utility itself is buggy as it overrides my page
setup from landscape to portrait and all fields are
resized and eventually truncated.