
CR 8.0 with MS SQL Server - database changing
Hi all
I am having problems while attempting to change the name of the SQL Server
and the database name in a report.
I have developed a report and used 'Convert Database Driver' to connect to
an SQL Server (as it was ODBC previously). That works fine in the Crystal
Report itself.
However, when I have tried to put this report onto a VB form, I ran into
problems.
I have a CRViewer control on the form.
I am trying to do the following ( as suggested on the knowledge base
http://www.*-*-*.com/ )
'general section of the form
Dim Appn As New CRAXDRT.Application
Dim cReport As CRAXDRT.Report
' button click section
For i = 1 To cReport.Database.Tables.Count
cReport.Database.Tables(1).SetLogOnInfo dbConfig.ServerName,
dbConfig.DatabaseName,
dbConfig.UserName, dbConfig.Password
Next
CRView.ReportSource = cReport
CRView.ViewReport
However, this it seems has no effect what so ever. The report will continue
opening the database with which it was originally created. Is there any
restriction on how to go about connecting to different SQL Servers during
runtime?
In addition. Is there anything that needs to be done so that the report will
not show whatever is the saved data inside it?
There's another section that passes in the parameter (note that there's no
parameter on the report - i just alter the condition for the selection
formula), but it work at times and at other it does not. For example, the
report source was previosly ODBC which I have then converted (as mentioned
above) into SQL Server based report. With ODBC in place, the passing in of
the condition worked well, after the conversion to SQL Server, I am unable
to pass in a condition using the following code:
strSelectionFormula = "{r_RFDReceivedByDateForCustomerForwarder.RFDDate} in
Date(..."yyyy,m,d") to Date(...)"
cReport.RecordSelectionFormula = strSelectionFormula
CRView.Refresh
My question is if there's any additional constraints if the driver is not
ODBC (using the System DSN) when it comes to modifications to the selection
formula?
Thanx in advance
Samir