error 20533 - datasource 
Author Message
 error 20533 - datasource

I am using Crystal Reports to display data in Access97 databases. The .rpt
file I create is based on a template .mdb file that I make beforehand.  When
the program runs, I tell crystal reports to use a new .mdb file which is
essentially the same file, just with new data in it.  This file has the same
table/field structure as the template.

The program runs fine as long as that template file is lying around.
However, when I remove the template file, the program gives me error 20533
"Unable to open database".   How can I tell the .rpt file to just use the
new database?

Thanks,
Daniel Williams



Sun, 19 May 2002 03:00:00 GMT  
 error 20533 - datasource
here is an example:
    For x = 0 To NumTableUsed
        CR.DataFiles(x) = MyPath                    '    CR is The
CrystalReport Control
        If CR.LastErrorNumber <> 0 Then
            Exit For
        End If
    Next x
pay attention to exact number of tables used in the Report (-1 'cause the
starting 0)
pay also attention to the 'path' which must include also the DataBaseName

This is for the OCX, if you use the DLL, take a look at this help:

PESetNthTableLocation:
Sets the location for a selected table in the specified print job. This
function is typically combined with PEGetNthTableLocation to identify the
location of a table and then to change it.

BOOL CRPE_API PESetNthTableLocation (
 short printJob,
 short tableN,
 PETableLocation FAR *location );

Parameters

printJob Specifies the handle of the print job for which you want to set a
table's location.
tableN Specifies the number of the table for which you want to set a new
location.
location Specifies the pointer to PETableLocation.
Return Value

TRUE (1) if the call is successful; FALSE (0) if the call fails.

Federico


Quote:

> I am using crystal reports to display data in Access97 databases. The .rpt
> file I create is based on a template .mdb file that I make beforehand.
When
> the program runs, I tell crystal reports to use a new .mdb file which is
> essentially the same file, just with new data in it.  This file has the
same
> table/field structure as the template.

> The program runs fine as long as that template file is lying around.
> However, when I remove the template file, the program gives me error 20533
> "Unable to open database".   How can I tell the .rpt file to just use the
> new database?

> Thanks,
> Daniel Williams



Mon, 20 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. error 20533

2. Error 20533 (Fixed - Sort of)

3. error 20533

4. error 20533

5. error 20533

6. VB Error 20533 Using Crystal Reports

7. VB Error Using 20533 Crystal Reports

8. 20533 error with CR6 OCX and subreports

9. error 20533 - Unable to open database

10. error 20533

11. Subreport: 20533-error

12. HELP : Error 20533

 

 
Powered by phpBB® Forum Software