Print Page | Close Window

Problem with SetLogonInfo and SQLServer DB

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20306
Printed Date: 27 Mar 2024 at 10:11pm


Topic: Problem with SetLogonInfo and SQLServer DB
Posted By: MikeNexcor
Subject: Problem with SetLogonInfo and SQLServer DB
Date Posted: 20 Dec 2013 at 3:31am

I am using Visual Basic 6 and Crystal Reports 8.5 and am having an issue with getting the SetLogOnInfo method to function with DSR files that have been created from Crystal Reports whose database location is set from a ODBC DSN to a MS SQLServerExpress 5.0 Database.

The following program code will not change the report's Database location using the following command:
crxReport.Database.Tables(1).SetLogOnInfo gstrDSN, "", DB_User, DB_Password
When the crxReport.Database.Tables(1).Location value is viewed in the VB6 development environment it has a value which includes the ServerName.dbo.tablename (from the value set in the original Crystal Report).
example: DBTest1.dbo.Vendors



This error does not occur when the underlying report's database location is set to an ODBC DSN to a MS Access database.
In this instance the above code successfully switches the report's database location to whatever SQLServerExpress or MS Access database is listed in the referenced DSN.
When the crxReport.Database.Tables(1).Location value is viewed in the VB6 development environment it has a value of just the tablename.
example: Vendors

I have seen some documents which discuss using a tables Connection Properties in examples for Crystal Reports 9.0 - I do not see these properties for tables in Crystal 8.5.

I do not know why the SetLogOnInfo method is not switching the Report database connection with DSR files that have been created from Crystal Reports whose database location is set from a ODBC DSN to a MS SQLServerExpress 5.0 Database.


Would anyone with knowledge of how to correct this issue please respond (whether with using SetLogOnInfo or some other method).






Print Page | Close Window