Solved

Crystal Reports: Error (20535) when printing from VB

Posted on 1998-01-07
6
4,780 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

12 Experts available now in Live!

Get 1:1 Help Now