Discussion Locked

Crystal Reports 4.6 + VB6 + File DSN

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a cystal report that was created by another developer. He has since left our organization and I am having trouble running it from within our Visual Basic 6 application. We are using SQL Server v. 7.0 and Crystal Reports v 4.6 (The version that shipped with VB6). We are using NT Authentication with our SQL Server database.

The developer who created the report used a DSN (either a User DSN or a Machine DSN) to connect to the SQL Server database. (I have attempted to connect to our database using the SQL OLEDB interface in Crystal Reports, but I get a message stating that Crystal Reports is currently in use and I need another license to access the report writer -So I guess we are stuck with using a DSN).

If I launch the report directly in the Crystal Reports application, it runs fine.

The application that will be using this report will be distributed to 100+ users, so we don?t want to set up a DSN on each client PC. I created a File DSN on my client, and after multiple attempts to Add the Database to the report and to Set the Location of the tables, I successfully launched the report from the VB6 user interface. When I move to another PC, however, I am unable to launch the report. When I drop down the Database|Add Database to Report menu on my client, select the Directory as q:\EB DSN (the location of my File DSN on the network) then click on the command button, I have a list of ODBC sources to choose from, and I have selected FDSN ? PM Crystal DSN.dsn. If I perform the same steps on the other client, (after I map Drive Q to the network location of my DSN) I do not have the FDSN as an optional selection.

Can anyone help me with this problem?

1 reply

by gbworld

You would be better to recode the connection string to the SQL Server database as a connection string, not a DSN. This is fairly easy:

Provider=SQOLEDB.1;Server=;Database=;UID=UserID;PWD=Password;

The file DSN may even be easier, although it further abstracts the connection string by placing it in a file and forcing the app to use the OLEDB ODBC provider (adding an extra layer) instead of just the OLEDB provider for SQL Server.

You can create a file DSN on anycomputer and then dump it into the application install path and use 'DSN = app.path & "\"' in your connection string.

The MSDN library has plenty of information. If you use the DSN, the connection string will basically be placed in a text file for the application to use. This file can be moved from computer to computer fairly easily.

Another option is to create an "install" to create the DSN on other computers, but you have stated that you do wish to do this.

Gregory A. Beamer
MCP: +I, SE, SD, DBA

This discussion is closed to new replies.