Hi everybody!
I'm trying to use this two methods from the crystal reports control (LogOnServer, LogOffServer) but I can't find no help about the way to use them.
CrystalReportControl.LogOnServer <dll as string>, <server as string>, <database as string>, <userid as string>, <password as string>
CrystalReportControl.LogOffServer <id as integer>, <all as boolean>
for the logoffserver method I supose that if I specify all = true then it'll log off all connections.
For the LogOnServer method I don't know what to specify in the dll parameter.
Overview of my project and situation:
I have two SQL Server Registrations.
I have two databases named the same, and with the same structure.
(Server1.Name, Server2.Name)
I have several reports that access the database.
The application can specify in witch server to fetch the information.
The report is only displaying the records from the server i specified when i created the report.
If I modify the report and logon the new server then it works.
Maybe there's another way to solve this instead of using LogOnServer and LogOffServer.
Here's the code i'm using to print the report:
With Menu.CrystalReport1
.Reset
.ReportFileName = <ReportPath>
.Connect = "driver={SQL Server};server=Server1;database=Name;uid=sa"
.WindowTitle = Me.Caption
.WindowState = crptMaximized
.Action = 1
End With
Thanks in advance