Problems setting database location at runtime. 
Author Message
 Problems setting database location at runtime.

In order to test a report while creating it, I set the database location to
a local directory on my C drive.

Problems are occuring when the software is installed on a test machine that
has a different directory structure than my development machine.  When I go
to display it, I change the data file location at runtime.  The only
difference with this report and others I've done like this is that there are
alias tables included in the report.

Here is the code I use to display the report...

  report.Reset
  report.ReportFileName = App.Path & "\Reports\inmatebillingopen.rpt"
  report.DiscardSavedData
  report.ParameterFields(0) = "sInmateID;" & txtInmateID & ";True"
  report.DataFiles(0) = App.Path & "\tigfacility.mdb"
  report.Destination = crptToWindow
  report.Action = 1

Upon further inspection, even though I'm telling it to search for the
database under the App.Path, its ignoring this and using what is hard coded
inside the Crystal Report.

I have verified this by making the directory structure exactly the same
between test and development machines.  When this was done, everything
worked fine.

What am I missing here?



Mon, 25 Mar 2002 03:00:00 GMT  
 Problems setting database location at runtime.
I had the same problem - and found no answer.
I used the same code as you with CR 4.6 and it worked fine!
I think it is a bug!
Quote:

> In order to test a report while creating it, I set the database location to
> a local directory on my C drive.

> Problems are occuring when the software is installed on a test machine that
> has a different directory structure than my development machine.  When I go
> to display it, I change the data file location at runtime.  The only
> difference with this report and others I've done like this is that there are
> alias tables included in the report.

> Here is the code I use to display the report...

>   report.Reset
>   report.ReportFileName = App.Path & "\Reports\inmatebillingopen.rpt"
>   report.DiscardSavedData
>   report.ParameterFields(0) = "sInmateID;" & txtInmateID & ";True"
>   report.DataFiles(0) = App.Path & "\tigfacility.mdb"
>   report.Destination = crptToWindow
>   report.Action = 1

> Upon further inspection, even though I'm telling it to search for the
> database under the App.Path, its ignoring this and using what is hard coded
> inside the crystal report.

> I have verified this by making the directory structure exactly the same
> between test and development machines.  When this was done, everything
> worked fine.

> What am I missing here?



Sat, 30 Mar 2002 03:00:00 GMT  
 Problems setting database location at runtime.
I've found that it works as long as you're not using subreports. But I
haven't found a way to pass the DataFile property value to the
subreports.



Quote:
> In order to test a report while creating it, I set the database
location to
> a local directory on my C drive.

> Problems are occuring when the software is installed on a test
machine that
> has a different directory structure than my development machine.
When I go
> to display it, I change the data file location at runtime.  The only
> difference with this report and others I've done like this is that
there are
> alias tables included in the report.

> Here is the code I use to display the report...

>   report.Reset
>   report.ReportFileName = App.Path & "\Reports\inmatebillingopen.rpt"
>   report.DiscardSavedData
>   report.ParameterFields(0) = "sInmateID;" & txtInmateID & ";True"
>   report.DataFiles(0) = App.Path & "\tigfacility.mdb"
>   report.Destination = crptToWindow
>   report.Action = 1

> Upon further inspection, even though I'm telling it to search for the
> database under the App.Path, its ignoring this and using what is hard
coded
> inside the crystal report.

> I have verified this by making the directory structure exactly the
same
> between test and development machines.  When this was done, everything
> worked fine.

> What am I missing here?

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 31 Mar 2002 03:00:00 GMT  
 Problems setting database location at runtime.
You dont say which version your using but 6 and 7 (32 bit) seem to work
fine. I also know that the 16 bit version 5.? had this problem.

TTFN
  Tom


Quote:
>I've found that it works as long as you're not using subreports. But I
>haven't found a way to pass the DataFile property value to the
>subreports.



>> In order to test a report while creating it, I set the database
>location to
>> a local directory on my C drive.

>> Problems are occuring when the software is installed on a test
>machine that
>> has a different directory structure than my development machine.
>When I go
>> to display it, I change the data file location at runtime.  The only
>> difference with this report and others I've done like this is that
>there are
>> alias tables included in the report.

>> Here is the code I use to display the report...

>>   report.Reset
>>   report.ReportFileName = App.Path & "\Reports\inmatebillingopen.rpt"
>>   report.DiscardSavedData
>>   report.ParameterFields(0) = "sInmateID;" & txtInmateID & ";True"
>>   report.DataFiles(0) = App.Path & "\tigfacility.mdb"
>>   report.Destination = crptToWindow
>>   report.Action = 1

>> Upon further inspection, even though I'm telling it to search for the
>> database under the App.Path, its ignoring this and using what is hard
>coded
>> inside the crystal report.

>> I have verified this by making the directory structure exactly the
>same
>> between test and development machines.  When this was done, everything
>> worked fine.

>> What am I missing here?

>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
Thomas B. Leitch


Sun, 28 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. setting adodc database location runtime

2. Setting database location at runtime

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

4. ???URGENT!!! Set Database Location in Runtime

5. Set database location path problem (OCX) (C++)

6. Set Location Problem to differenct database using ODBC

7. Problems setting report database location

8. Crystal 4.6 set database location - same as database

9. How can I set the table location from VB6 to a subreports in runtime

10. Correct way to Set DB Location at runtime?

11. How do you set file location at runtime?

12. set text file location (source) runtime

 

 
Powered by phpBB® Forum Software