Dim crReport As New ReportDocument Dim crDatabase As Database Dim crTableLoginfo As New TableLogOnInfo() Dim crConnectionInfo As New ConnectionInfo() Dim crTables As Tables Try crReport.Load(My.Application.Info.DirectoryPath.ToString() & "\PrintAll.rpt") With crConnectionInfo .ServerName = My.Application.Info.DirectoryPath.ToString() & "\JakeRe.accdb" .DatabaseName = "JakeRe.accdb" .UserID = "admin" .Password = "password" .IntegratedSecurity = True End With crDatabase = crReport.Database crTables = crDatabase.Tables For Each crTable As Table In crTables crTableLoginfo = crTable.LogOnInfo crTableLoginfo.ConnectionInfo = crConnectionInfo crTable.ApplyLogOnInfo(crTableLoginfo) Next CrystalReportViewer1.ReportSource = crReport CrystalReportViewer1.Refresh() Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Error Found!") End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)