Yes , we do it. But I have noticed something. We do it after assigning the FileDSN at runtime. Should it be before?
We also disable the "File - save data with report" option during design.
Thanks.
>The ConnectBufferString property is readonly. Are you doing
>
>IF oRpt.HasSavedData
> oRpt.DiscardSavedData()
>ENDIF
>
>
>>Hello Craig,
>>
>>I asked a question some days ago but didn't get answers. This is about changing the datasource at runtime for a Crystal report.
>>
>>More details.
>>
>>We design a report based on a stored procedure which is stored in a given server and database, say Test_Server and Test_Database. It runs fine from development environment, but of course I would need to run the report on production on a different server and database without having to re-edit and change the report specifications. I need to do it by just changing de DSN file the .rpt is referring to.
>>
>>What properties or what code do I have to implement? I have tried for example:
>>
>>
>>oCProps.Add("FILEDSN", MyDSNFile)
>>
>>loRPT.Database.Tables(n).ConnectBufferString= 'FILEDSN=H:\MyDSNFile)
>>
>>
>>and so on, but nothing seems to work. The report still tries to find the development database, and if we rename it , we get errors like "Failed to open rowset" ,
>>
>>
>>I also applied an update named CR90MAINWIN_EN_200603 without success.
>>
>>
>>Please some ideas,
>>
>>Thanks
>>
>>Juan C.