# Re: try going here to find the answer....

Posted by Olav Traa on August 17, 1999 at 07:13:21:

In Reply to: try going here to find the answer.... posted by Scott CJC on August 16, 1999 at 09:27:14:

Scott/Olav

Thanks very much. I have been to Seagate's site, (and several others for that matter) the problem I am have is with password protected databases and subreports. I was able to pass value down sub the subrprts when there was no security issue. I have, however, found a solution and it looks like this:
'***********
Private Sub VcLogin(UserName As String, Password As String)

Dim iCounter As Integer

'with this syntax I can set values for the main report
Main.CrystalReport1.SubreportToChange = ""

Main.CrystalReport1.UserName = UserName
Main.CrystalReport1.Password = Password
Main.CrystalReport1.SessionHandle = 0 'default value
For iCounter = 0 To (Main.CrystalReport1.GetNSubreports - 1)
'with this syntax I can set the values for each particular subreport.
Main.CrystalReport1.SubreportToChange = Main.CrystalReport1.GetNthSubreportName(iCounter)
Main.CrystalReport1.UserName = UserName
Main.CrystalReport1.Password = Password
Main.CrystalReport1.SessionHandle = 0 'default value

Next iCounter
End Sub
'*********

It seems to work splendidly. What do you think?

Take Care,
Olav Traa
Montreal

Follow Ups: