Repost: changing server name at run-time 
Author Message
 Repost: changing server name at run-time

Hi, I asked this Q before. I need to set the SQL ServerName at run-time for
my reports. We have the same database on different servers. I created one
report for them all. However the problem is that the CRViewer.dll (CR8) has
a problem changing the servername using:
Report.Database.Logonserver
"p2ssql.dll","SERVERA","DBASENAME","Username","Password"

Does any1 have a different solution?

Thanks.

Vincent



Wed, 10 Sep 2003 10:55:54 GMT  
 Repost: changing server name at run-time
Vincent,

use this instead...

    For i = 1 To Report.Database.Tables.Count
        Set CRTable = Report.Database.Tables.Item(i)
        CRTable.SetLogOnInfo "SERVER", "DATABASE", "UID", "PWD"
    Next i

D.-

PS: if your report contains subreports, you will have to open them and
execute the above loop on their tables as well.


Quote:
> Hi, I asked this Q before. I need to set the SQL ServerName at run-time
for
> my reports. We have the same database on different servers. I created one
> report for them all. However the problem is that the CRViewer.dll (CR8)
has
> a problem changing the servername using:
> Report.Database.Logonserver
> "p2ssql.dll","SERVERA","DBASENAME","Username","Password"

> Does any1 have a different solution?

> Thanks.

> Vincent



Wed, 10 Sep 2003 22:08:30 GMT  
 Repost: changing server name at run-time

Quote:
> Vincent,

>     For i = 1 To Report.Database.Tables.Count
>         Set CRTable = Report.Database.Tables.Item(i)
>         CRTable.SetLogOnInfo "SERVER", "DATABASE", "UID", "PWD"
>     Next i

A slightly cleaner syntax is

 for each table in Report.Database.Tables
       ' ...
 next



Thu, 11 Sep 2003 03:59:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Changing a tables name at run time

2. Changing field names at Run time

3. Changing Group Names at Run-Time - !!!

4. How to change database name at run time

5. Change Server at Run Time

6. Crystal Reports and asp- re: dynamically change servers and databases at run time

7. Change SQL Server at run time???

8. How to pass Database name and Stored Procedure Name at run time in subreports

9. Repost: Creating ActiveX controls at run-time

10. changing Server Name with SQL Server(Urgent)

11. Changing control name of button doesn't change event name to be the same

12. Changing system time without changing appt. time

 

 
Powered by phpBB® Forum Software