Solved

Crystal Reports: Error (20535) when printing from VB

Posted on 1998-01-07
6
4,812 Views
Last Modified: 2012-06-27
Error when printing from a VB application
Win95, VB5, CR6, Access97
---

Hi,

When I press the print button in my VB application I get the following message:

SEAGATE CRYSTAL REPORTS: DATABASE ERROR
Error opening file.
File could not be opened: "LTF", at file location: "LTF"
[OK]

LTF is a table in my Access database. After that, this message appears:

Run-time error '20535':
Unable to connect: incorrect session parameters.
[OK]

This is because the .rpt file calls a database (.mdb) that doesn't exist, and that's because I moved it (the .mdb) to another location as my customers probably wants to do. So, I need a way to change the location in runtime.

I was reading the KB at Seagate today and found this interresting note:

"A VB application is using Crystal Reports 5.0 witch in turn is connecting to an Access database. The Report1.Datafiles property is used to point to a different database at runtime."

This is exactly the property I need, but it does not exist in CR6! What happened to the DataFiles property? How am I
supposed to change database at runtime without this
property?
0
Comment
Question by:liljegren
6 Comments
 

Author Comment

by:liljegren
ID: 1449725
Edited text of question
0
 

Expert Comment

by:nithyas
ID: 1449726
I've worked with CR 3, 4.6. But don't think CR 5.0 is much different from either in this respect.

Once you make changes to the database (moving the database or changing the structure of the database), you'd need to reset the location. This can be done by selecting 'Set Location' from the  Database menu. This displays all the tables and the location of each table is displayed in a label. Check the table links before and after resetting the database. I personally haven't encountered any problems but heard that they might disappear sometimes.


0
 

Author Comment

by:liljegren
ID: 1449727
No help for me unfortunately. I must find a way to do this in runtime (i.e. from my VB application). I know the Set Location command in Crystal Reports, but I can't ship the reports with a fixed path. This path could be changed in runtime with DataFiles property before, but now this property don't exist in Crystal Reports.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Expert Comment

by:rantanen
ID: 1449728
I don't have CR 6.0 but been also reading some Seagate documentation and it mentions DataFiles as one of the properties of CR ActiveX control.

But isn't it so that the Active Data Driver gives you this capability? I have understood that you use DAO, RDO or ADO to get your data and then you use Crystal's CDO to access this data from the application memory.

I hope this is some help.
0
 
LVL 6

Accepted Solution

by:
anthonyc earned 100 total points
ID: 1449729
My version 6.0 has datafiles.....

crystalreport1.datafiles(0) = "c:\your\path\to\access.mdb"

Its a array, containing many files (for dbase, or linking dbs)
0
 

Author Comment

by:liljegren
ID: 1449730
Yes, it's right. :-) At last I figured out that there was an "hidden" Datafiles propety. It's no help for this in my help file for CRYSTL32.OCX.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Formula to Randomize Data Set for Time Series Visual 1 85
Hide vba in gp 7 79
VBA Shell can't Find Word document 11 73
Macro Excel - Multiple If conditions 2 62
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now