Hello ,
We have been running our reports on 2 differente servers, say 'test_server' and 'prod_server'. In both cases the original database was named 'QNECT'.
We used to re-define a DSN property during run-time in order to specify a different DSN file which indicates the server and database to connect to. We do it this way:
loCR= CREATEOBJECT( "CrystalRuntime.Application")
loRpt= loCR.OpenReport( lcPathReport )
LOCAL oCProps as CRAXDRT.ConnectionProperties
lnTables = loRpt.Database.Tables.Count
FOR h = 1 TO lnTables
oCProps = loRpt.Database.Tables(h).ConnectionProperties
oCProps.DeleteAll
oCProps.Add("DSN",THISFORM.report_dsn)
NEXT h
IF loRpt.HasSavedData
loRpt.DiscardSavedData()
ENDIF
Thisform.oleCRViewer.ReportSource= loRpt
thisform.oleCRViewer.refreshEx
Thisform.oleCRViewer.ViewReport()
But we have created a new database named QNECT_TEST and Crystal reports keep searching for the original database name and displaying an error like this:
Crystal report viewer:
failed to open a rowset.
Details: 08004 SQL Native client. Could not locate entry in sysdatabases for database 'QNECT'. No entry found with that name. Make sure that the name is entered correctly
Of course the DSN file already keeps a reference to the new database name, but Crystal is not 'seeing' this value?
How can we tell Crystal to use my parameters from the DSN file and use a differente database name at runtime? It's accepting a different server, but not a different database name, no matter structures are the same.
Thanks.
Juan C.