Link to home
Start Free TrialLog in
Avatar of liljegren
liljegrenFlag for Sweden

asked on

Crystal Reports: Error (20535) when printing from VB

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?
Avatar of liljegren
liljegren
Flag of Sweden image

ASKER

Edited text of question
Avatar of nithyas
nithyas

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.


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.

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.
ASKER CERTIFIED SOLUTION
Avatar of anthonyc
anthonyc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.