I am trying to create CR8 reports that run off of SQL Server 2000 databases using an ODBC DSN. The reports are to be viewed through both a VB Application and an ASP Project. It works in the Crystal Reports Environment, and can be displayed in the VB Application (I haven't tried in the ASP project yet), but I can't seem to change the DSN that the report is connecting to.
I dynamically create a dsn connection using the SQLConfigDataSource API function and attempt to use this for the report by calling
for each table in the report (and sub report).
The report displays without any error messages, but the data displayed is still the original data that the report was written with. If I go back into the Crystal Report Environment and "Set Location" to the newly created DSN, the report displays the new data correctly.
Is there a problem with my call to SetLogOnInfo? Do I need to call an additional function, or set a certain parameter? I have created the DSN using a trusted connection (in the future I will support both trusted and non-trusted).
I dynamically create a dsn connection using the SQLConfigDataSource API function and attempt to use this for the report by calling
Code:
SetLogOnInfo(DSNName, DatabaseName, User, Pwd)
The report displays without any error messages, but the data displayed is still the original data that the report was written with. If I go back into the Crystal Report Environment and "Set Location" to the newly created DSN, the report displays the new data correctly.
Is there a problem with my call to SetLogOnInfo? Do I need to call an additional function, or set a certain parameter? I have created the DSN using a trusted connection (in the future I will support both trusted and non-trusted).