
Connection not Open + Server has not yet been opened error messages
When trying to run a CR8 report from VB6 which is using data from a SQL
server 7 the following errors are appearing when the .viewreport command is
run.
Seagate Crystal Reports: Database Error
ODBC error: [Microsoft][ODBC Driver Manager] Connection not open
then
Crystal Report Viewer
Server has not yet been opened.
Below is the relevant section of code.
Set Rst = cmd.Execute
Report.Database.LogOnServer "p2ssql.dll", "MYSQLServer", "MYDB", "Username",
"Password"
Report.Database.SetDataSource Rst
Report.DiscardSavedData
Report.AutoSetUnboundFieldSource crBMTName
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Report.Database.LogOffServer "MYSQLServer", "MYDB", "Username", "Password"
Report is defined as the Crystal Report Designer report.
After the cmd.execute line is run data is returned from the recordset (rst).
Why are these error messages appearing with Crystal Reports 8 even though a
connection to the database has already been made and data returned?
How can this problem of the CR8 connection to SQL 7 be fixed?