Thanks for your help, deceptikon. I have gone through the steps in article 155666 in detail but without success. I will also examine the article you suggest and try everything that it recommends - will let you know next week how I go.

No, I'm not sure my connection string is right. I followed TnTinMN's suggestion (adding 'dns=' to the beginning of the connection string) but it produces an error, "ODBC--connection to 'database.mdb' failed." I then tried eliminating the password from the database and connection string (so that the connection string is "dns=Access"), but this produces the same error. (Note that when the database has no password and the connection string is just the word "Access", it works perfectly.) Next I tried having a look at the ODBC connection for Access 97 and got 2 error messages:

"The setup routines for the Microsoft Access Driver ODBC driver could not be found. Please reinstall the driver."

"Errors found: The specified DSN contains an architecture mismatch between the Driver and Application."

I have the original disk for Access 97 (which I'm using) and have reinstalled that as part of following article 155666, but without fixing the problem.

I'd appreciate any further help you can give. Also note that I currently have another thread going with a page orientation issue in Crystal Reports.


Thanks for the tip, QVeen72. I won't pursue that option any more.

I'm already using the code you have provided, so it isn't the solution to my problem. The report selected by the user appears in the preview window, but always with the page orientation setting of the printer, not the report. I need it to ignore the page orientation setting of the priner and use the setting in the report.

Thanks for trying, though, Please let me know if you have any other ideas...


The "User-defined type not defined" error occurs on this line:

Dim repApp As CRAXDRT.Application

Making a change to a later line won't alter the fact that it doesn't compile.


Thanks for your reply, but how do I get around the User-defined type not defined" compilation error?


I am writing a VB app that provides the user with a menu of reports written in Crystal Reports 4.6. When the user selects a report, it is shown in the Crystal Reports preview window from where it can be printed to the selected printer.

My problem is that the page orientation is derived from the printer, not the report. I need the orientation to be portrait or landscape depending on the report selected, not the printer. If the selected printer is set up as portrait but the report is landscape, I need it to print in landscape (and vice versa). I don't want the user to have to touch the printer setup.

I have found the following code segment that looks like it might be a solution:

Dim repApp As CRAXDRT.Application
Dim cryReport As CRAXDRT.Report
Set cryReport = repApp.OpenReport(strRptName, 1) 'where strRptName has been set up as the report name
cryReport.PaperOrientation = crLandscape

However, it gives me a "User-defined type not defined" error on compile. I need to know how to make it work so that I can test it. Or if you don't think it's the solution I need, perhaps you have some other suggestions?



Hi all,

Can someone please help me. I'm writing a VB5 app that connects to an Access 97 database using a data access control with the following parameters:

Connect = "Access"
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset

(The app sets the DatabaseName and RecordSource properties at runtime.)

When the database doesn't have a password, it works perfectly. But when I give it a password ("OpenSesame") and change the Connect string to "Access;pwd=OpenSesame", I get this error:

"Couldn't find installable ISAM."

I need to solve this so that my database can be password-protected. Any ideas?

I will also need to connect to the database from Crystal Reports, but first things first!


I am writing an application in Visual Basic 5.0 that calls Crystal Reports 4.6.

I used to be able to do this on my old PC which ran Windows XP, but now when I try to do it on my new PC which is running Windows 7 (64-bit), I can't add the Crystal Report component to my VB project - I get a registry error.

I would love to know how to overcome this. I know I'm using outdated software, but I'm really hoping there's a solution that doesn't involve upgrading.

Thanks very much for your help.