how to pass a password to crystal report 9.0 from vb6.0??!

E

edmond

Is there any way passing a password to crystal report 9.0 from Visual Basic
6.0. so that when loading the report in vb6.0., it can connect to the
database access file and show the report?

Thanks a lot.
 
J

Joe Fallon

No idea.
But I use this in VB.Net to do it:


Public Sub SetConnectionForReports(ByVal ReportDoc As ReportDocument)
Dim crTable As Table
Dim crTables As Tables
Dim crDatabase As Database
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo

Try
crDatabase = ReportDoc.Database
crTables = crDatabase.Tables

With crConnectionInfo
'assign public variables
.ServerName = Server
.UserID = PnetUid
.Password = PnetPwd
.DatabaseName = Database
End With

For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next crTable

End Try

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

Top