Change Database Location at run-time 
Author Message
 Change Database Location at run-time

I am using the Designer Component 6 in VB 6 ( database is Access 97, using
DAO 3.51 ).  I need to change the database location of the reports using VB
code.  Pretty simple problem as it seems ...   But everything I've tried
leads to an errror :)

Any suggestions ?

thanx



Mon, 03 Jun 2002 03:00:00 GMT  
 Change Database Location at run-time
write a sepparate routine that handles the database location setting. In
english, you must loop through the table collection you are using in your
RPT file. Each table must be set to this new location. Notice in the
following routine that you must use this emediately after you set the
reportnfile name property.

Public Sub set_rpt_db_location(pCRWControl As CrystalReport, pLocation As
String)
    Dim wNumOfDataFiles As Integer
    Dim wDataFileLoop As Integer

    'NOTE: this routine may be called only after the
    'ReportFileName property has been set

    wNumOfDataFiles = pCRWControl.RetrieveDataFiles

    For wDataFileLoop = 0 To (wNumOfDataFiles - 1)
        pCRWControl.DataFiles(wDataFileLoop) = pLocation
    Next 'wDataFileLoop
End Sub

hope this helps...

Rob Waller

Quote:

>I am using the Designer Component 6 in VB 6 ( database is Access 97, using
>DAO 3.51 ).  I need to change the database location of the reports using VB
>code.  Pretty simple problem as it seems ...   But everything I've tried
>leads to an errror :)

>Any suggestions ?

>thanx



Mon, 10 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to change Database location at run time

2. Changing database location at run-time

3. Changing database location at run time

4. How to change database location at runtime

5. Changing Database\Table locations at run-time from VB6

6. Run Time Change of DB Location, Setting Passwords, and Rpt Location

7. ADO Data Control - Design Time/Run Time database locations

8. CR9 does not change table location at run time

9. Changing Access mdb location in run time

10. Change TTX location at Run-Time - Please Help....

11. Setting a database location at run time?

12. Crystal Report -- set location of database at run time

 

 
Powered by phpBB® Forum Software