Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Reports: Error (20535) when printing from VB

Posted on 1998-01-07
6
Medium Priority
?
4,986 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses

721 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