Set Password in Crystal Report

  • Thread starter Thread starter Red
  • Start date Start date
R

Red

Hi all,
Im having password for my database in ms Access, Anyone
know how to set the password in crystal report if I want
to connect the database.
Thanks
 
--
Regards,
Andy O'Neill
www.wargamer.pwp.blueyonder.co.uk/index.htm
or, for no javascript and a faster load...
www.wargamer.pwp.blueyonder.co.uk/sitemap.htm
Red said:
Hi all,
Im having password for my database in ms Access, Anyone
know how to set the password in crystal report if I want
to connect the database.
Thanks

It's part of the connectionInfo.
So something like:

Sub set_params_run(ByRef crdoc As
CrystalDecisions.CrystalReports.Engine.ReportDocument)
' Switch database
'-----------
Dim log As TableLogOnInfo
Dim tbl As Table

crConnectionInfo = New ConnectionInfo()
With crConnectionInfo
.ServerName = Server_Name()
.DatabaseName = Database_Name()
.UserID = " "
.Password = " "
End With
For Each tbl In crdoc.Database.Tables
log = tbl.LogOnInfo
log.ConnectionInfo = crConnectionInfo
tbl.ApplyLogOnInfo(log)
tbl.Location = tbl.Name
Next

Me.crViewer.ReportSource = crdoc

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top