Solved

Crystal Reports: Error (20535) when printing from VB

Posted on 1998-01-07
6
4,840 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

778 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