Crystal Reports Database location problem 
Author Message
 Crystal Reports Database location problem

I am having a problem with a program I am writing using a report created in
the Crystal Reports that comes with VB4.0 Pro.  After I install the program
on the target system and I try to call the report I get a,

Run Time Error 20534
Error Detected by Database DLL

After tracking it down I found that the problem was that the location of
the database file isnt in the same location from when I designed it on my
system.  I wrote code to determine the location of the database for my data
control ect. but how do I tell the report file where it is.  There didnt
seem to be a property for it.

I have the database in the same directory the report file and the program
EXE are located in.  Is there a setting in crystal reports to tell it to
look in the current dir?

Any suggestion would be appreciated.

Thanks in advance

Dan Finch



Sun, 04 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem


Quote:

>After tracking it down I found that the problem was that the location of
>the database file isnt in the same location from when I designed it on my
>system.  I wrote code to determine the location of the database for my
data
>control ect. but how do I tell the report file where it is.  There didnt
>seem to be a property for it.

>I have the database in the same directory the report file and the program
>EXE are located in.  Is there a setting in crystal reports to tell it to
>look in the current dir?

Yes there is. While you are designing the report look under "Database"
then under "Location". You should see a button that says "Same as
Reports".

If you need more help, let me know.

Travis Pitts
Alegis Systems Group



Sun, 04 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem



Quote:
> I am having a problem with a program I am writing using a report created
in
> the crystal reports that comes with VB4.0 Pro.  After I install the
program
> on the target system and I try to call the report I get a,

> Run Time Error 20534
> Error Detected by Database DLL

> I have the database in the same directory the report file and the program
> EXE are located in.  Is there a setting in crystal reports to tell it to
> look in the current dir?

> Any suggestion would be appreciated.

> Thanks in advance

> Dan Finch

You can set the database location at runtime with the datafiles property.
ex:
report1.datafiles(0)="c:\path\mydatabase.mdb"
this should solve your problem.

by the way I knew a Dan Finch in college. You didn't attend Evangel College
in Springfield Mo. by any chance did you?

Paul Ross



Sun, 04 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem


Quote:
> I have the database in the same directory the report file and the
program
> EXE are located in.  Is there a setting in crystal reports to tell it
to
> look in the current dir?

--

Dan,
I use a global database variable in my application called 'gdbOLIS' and
assign the 'Name' property of 'gdbOLIS' to the 'DataFiles(0)' property
of the Crystal Report control 'crReport01'.  Since my reports may not
be in the same directory as the database, or even the application, I
also set the reports location using a variable at run time.  In the
following code snippet, my application uses an INI file to store the
database location, while it is understood that the reports are going to
reside in the Application directory.
The report path could have also been stored in the INI file for greater
flexibility.

  ' Set Crystal Report control database location
  crReport01.DataFiles(0) = gdbOLIS.Name                   ' global
database object

  ' Set CR report source directory
  msLocation = LCase(App.Path)                                  ' uses
the application path
  If Right$(msLocation, 1) <> "\" Then
    ' handles the root
    msLocation = msLocation & "\"
  End If

  ' Report path and name
  crReport01.ReportFileName = msLocation & "prem_dtl.rpt"           '
assign the report location

Hope I haven't confused you.  Good luck,

Larry Fee
Systems Division, Corporate and Strategic Programs
Ministry of Health, Victoria  BC  Canada
Phone: (250) 952-1413        Fax..: (250) 952-2308



Quote:
> I am having a problem with a program I am writing using a report
created in
> the crystal reports that comes with VB4.0 Pro.  After I install the
program
> on the target system and I try to call the report I get a,

> Run Time Error 20534
> Error Detected by Database DLL

> After tracking it down I found that the problem was that the location
of
> the database file isnt in the same location from when I designed it
on my
> system.  I wrote code to determine the location of the database for
my data
> control ect. but how do I tell the report file where it is.  There
didnt
> seem to be a property for it.

> I have the database in the same directory the report file and the
program
> EXE are located in.  Is there a setting in crystal reports to tell it
to
> look in the current dir?

> Any suggestion would be appreciated.

> Thanks in advance

> Dan Finch



Sun, 04 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem



Quote:
> I am having a problem with a program I am writing using a report created
in
> the crystal reports that comes with VB4.0 Pro.  After I install the
program
> on the target system and I try to call the report I get a,

> Run Time Error 20534
> Error Detected by Database DLL
> I have the database in the same directory the report file and the program
> EXE are located in.  Is there a setting in crystal reports to tell it to
> look in the current dir?

Dan:

  BTDT.  In my current project, I keep the report in the application
directory.  The user can put his/her database where-ever they wish, but the
reports, written by me, are packaged and shipped with the application.  As
such, I use App.Path to determine where they are.  The code is very rough
and not at all complete, but it works.  What is missing is error
checking...  oops...  hey, it's just a sample....

  If you are using the custom control, simply set the DatabaseName member
of the control, if you
are using the API, (note this, is version CRW 5.0) the following code may
point you in the right direction.

Private Sub cmdView_Click()
Dim strPathName As String
Dim hJob As Integer
Dim iResult As Integer
Dim SessionInfo As PESessionInfo
Dim TitleHandle As Long, TitleLength As Integer, ReportTitle As String
Dim tableLocation As PETableLocation
Dim paramInfo As PEParameterFieldInfo
Dim paramCount As Integer
Dim iCurParam As Integer
Dim strIncluded As String
    '''' Much has been removed from this sample in order to make it
readable.....
    If (Right$(App.Path, 1) <> "\") Then
        strPathName = LCase(App.Path) + "\"  'handles the root
    Else
        strPathName = LCase(App.Path)
    End If
    hJob = PEOpenPrintJob(strPathName & "Calendar.rpt")
    tableLocation.StructSize = PE_SIZEOF_TABLE_LOCATION
    iResult = PEGetNthTableLocation(hJob, 0, tableLocation)
    tableLocation.Location = DBName & Chr$(0)
    iResult = PESetNthTableLocation(hJob, 0, tableLocation)
    ''' Snip '''
    iResult = PEOutputToWindow(hJob, "Calendar Report", 50, 50, _
                Me.Width \ Screen.TwipsPerPixelX, Me.Height \ Screen.TwipsPerPixelY, _
                0, frmSRSMDI.hMainWnd)
    iResult = PEStartPrintJob(hJob, True)
    PEClosePrintJob hJob
End Sub



Wed, 07 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem


Quote:


>> I am having a problem with a program I am writing using a report
created
>in
>> the crystal reports that comes with VB4.0 Pro.  After I install the
>program
>> on the target system and I try to call the report I get a,

>> Run Time Error 20534
>> Error Detected by Database DLL

>> I have the database in the same directory the report file and the
program
>> EXE are located in.  Is there a setting in crystal reports to tell it
to
>> look in the current dir?

Goto to Crystal Reports and check a few things:

1) From FILE-REPORT options, make sure under the convert report option
that you have MS DAO listed.  If it says MS JET, just select MS DAO and
make sure the checkbox is 'checked'.  (MS JET is used with VB 3.  Although
you can use this in VB 4, setup lizard usually fails to include the
appropriate DLL's for this.)

2) Goto DATABASE-SET LOCATION and select the 'Same as report' button.
3) Enable DATABASE-VERIFY ON EVERY PRINT
4) Goto REPORT-REFRESH REPORT DATA
5) Save your work.

Try this and see if it works.

John



Sat, 10 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem

Quote:

>I am having a problem with a program I am writing using a report created in
>the crystal reports that comes with VB4.0 Pro.  After I install the program
>on the target system and I try to call the report I get a,
>Run Time Error 20534
>Error Detected by Database DLL
>After tracking it down I found that the problem was that the location of
>the database file isnt in the same location from when I designed it on my
>system.  I wrote code to determine the location of the database for my data
>control ect. but how do I tell the report file where it is.  There didnt
>seem to be a property for it.
>I have the database in the same directory the report file and the program
>EXE are located in.  Is there a setting in crystal reports to tell it to
>look in the current dir?
>Any suggestion would be appreciated.
>Thanks in advance
>Dan Finch

There are a couple of properties I always set at print time from
code as follows:

Report1.ReportFileName = App.Path & "\rptname.rpt"
Report1.DataFiles(0) = vFile    'vFile is a variable containing the
                                'fully qualified path/filename of the
                                'data file

You have to repeat the 2nd line above (DataFiles(1), etc., for every
table from the datafile you use in the report. That should take
care of it...

Hope it helps.

        Dave Allen
        Space Science & Engr. Ctr.
        UW-Madison

 epo



Tue, 13 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem


Quote:
Allen) writes:

>>I am having a problem with a program I am writing using a report created
in
>>the crystal reports that comes with VB4.0 Pro.  After I install the
program
>>on the target system and I try to call the report I get a,

>>Run Time Error 20534
>>Error Detected by Database DLL

>>After tracking it down I found that the problem was that the location of
>>the database file isnt in the same location from when I designed it on
my
>>system.  I wrote code to determine the location of the database for my
data
>>control ect. but how do I tell the report file where it is.  There didnt
>>seem to be a property for it.

>>I have the database in the same directory the report file and the
program
>>EXE are located in.  Is there a setting in crystal reports to tell it to
>>look in the current dir?

>>Any suggestion would be appreciated.

>>Thanks in advance

>>Dan Finch

>There are a couple of properties I always set at print time from
>code as follows:

>Report1.ReportFileName = App.Path & "\rptname.rpt"
>Report1.DataFiles(0) = vFile        'vFile is a variable containing the
>                                'fully qualified path/filename of the
>                                'data file

>You have to repeat the 2nd line above (DataFiles(1), etc., for every
>table from the datafile you use in the report. That should take
>care of it...

>Hope it helps.

>    Dave Allen
>    Space Science & Engr. Ctr.
>    UW-Madison

>epo

One addition to the above:  I was told by tech support to make sure
"Verify Database on Every Print" is checked to ensure that the database
location would be found.  It seems to work for me either way when running
it through VB 4, but there's probably some situations that require this
step.

John



Tue, 13 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem

I am having the same problems as Dan Finch.  Same exact setup.

I tried your suggestions, but still no go.  I also tried opening up the
report in CR and then doing a "Database ... Set Location ... Same As
Report", and that didn't help either.

Any other suggestions?

Thanks in advance.

Matt



Quote:

> >I am having a problem with a program I am writing using a report created
in
> >the crystal reports that comes with VB4.0 Pro.  After I install the
program
> >on the target system and I try to call the report I get a,

> >Run Time Error 20534
> >Error Detected by Database DLL

> >After tracking it down I found that the problem was that the location of
> >the database file isnt in the same location from when I designed it on
my
> >system.  I wrote code to determine the location of the database for my
data
> >control ect. but how do I tell the report file where it is.  There didnt
> >seem to be a property for it.

> >I have the database in the same directory the report file and the
program
> >EXE are located in.  Is there a setting in crystal reports to tell it to
> >look in the current dir?

> >Any suggestion would be appreciated.

> >Thanks in advance

> >Dan Finch

> There are a couple of properties I always set at print time from
> code as follows:

> Report1.ReportFileName = App.Path & "\rptname.rpt"
> Report1.DataFiles(0) = vFile       'vFile is a variable containing the
>                                 'fully qualified path/filename of the
>                                 'data file

> You have to repeat the 2nd line above (DataFiles(1), etc., for every
> table from the datafile you use in the report. That should take
> care of it...

> Hope it helps.

>    Dave Allen
>    Space Science & Engr. Ctr.
>    UW-Madison

>  epo



Sun, 18 Jul 1999 03:00:00 GMT  
 Crystal Reports Database location problem


Quote:
>I am having the same problems as Dan Finch.  Same exact setup.

>> >I am having a problem with a program I am writing using a report created
>in
>> >the crystal reports that comes with VB4.0 Pro.  After I install the
>program
>> >on the target system and I try to call the report I get a,

>> >Run Time Error 20534
>> >Error Detected by Database DLL

Try this:
    CrystalReport1.ReportFileName = App.Path & "\ReportName.rpt"
    CrystalReport1.DataFiles(0) = App.Path & "\DatabaseName.mdbt"
On my current project it is possible to open a database in another
directory so I used CurDir instead of App.Path for the database.
Eric L. Jennings          

Crossroads http://bytor.chemek.cc.or.us/~ericj/


Tue, 20 Jul 1999 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Reports written in Crystal - database has moved - how can I respecify the database location

2. Database Location in Crystal Reports 4.5 & VB4

3. Location of database for Crystal Report - HELP !!!!!!

4. crystal reports- setting database location

5. Crystal reports database location

6. Crystal Reports and defining the location of the database on a network

7. How do you pass Database Location to Crystal Reports (W/O print engine)

8. Setting Crystal Report Database Location at RunTime...

9. Location of database for Crystal Report - HELP !!!!!!

10. -Help- Setting Crystal Reports.Net Database Location

11. How can i programmically Set Location of my database in Crystal Report of vb.net

12. Changing Crystal Report database location at runtime

 

 
Powered by phpBB® Forum Software