Вложенный отчет с crystalreports в vb6 и access db
как создать вложенный отчет с помощью crystalReports в vb6 и получить доступ к db=?
в моем коде у меня ошибка входа в систему не удалось
пожалуйста, помогите мне, спасибо
Что я уже пробовал:
Private Sub lvButtons_H6_Click() Dim Rs As New ADODB.Recordset If Rs.State = 1 Then Rs.Close ' If Rs.State = 1 Then Rs.Close If StrSQL = "" Then Rs.Open "SELECT ID,GroupName,Fname,LName FROM tblMain ORDER BY ID ASC", Conn, adOpenStatic, adLockOptimistic Else On Error Resume Next Rs.Open StrSQL, Conn, adOpenStatic, adLockOptimistic End If StrSQLPrint = Rs.Source Set Me.VS.DataSource = Rs PrintMember StrSQLPrint End Sub Private Sub PrintMember(StrSQL As String) 'On Error GoTo E_R Dim Rs As New ADODB.Recordset 'Dim ObjApp As New CRAXDRT.Application 'Dim ObjRpt As New CRAXDRT.report 'Dim crDBTab As CRAXDRT.DatabaseTable If Rs.State = 1 Then Rs.Close 'MsgBox StrSQL, vbCritical Rs.Open StrSQL, Conn Dim CrxApp As CRAXDRT.Application Dim CrxRep As CRAXDRT.report Dim crxSubreport As CRAXDRT.report Dim crxSubreportObject As SubreportObject Dim crxDatabase As CRAXDRT.Database Dim crxDatabaseTables As CRAXDRT.DatabaseTables Dim crxDatabaseTable As CRAXDRT.DatabaseTable Dim crxSections As CRAXDRT.Sections Dim crxSection As CRAXDRT.Section Dim CRXReportObject As Object Set CrxApp = New CRAXDRT.Application Set CrxRep = CrxApp.OpenReport(App.Path & "\Reports\R.rpt") CrxRep.Database.SetDataSource Rs Set crxSections = CrxRep.Sections For Each crxSection In crxSections For Each CRXReportObject In crxSection.ReportObjects If CRXReportObject.Kind = crSubreportObject Then Set crxSubreportObject = CRXReportObject Set crxSubreport = crxSubreportObject.OpenSubreport Set crxDatabase = crxSubreport.Database Set crxDatabaseTables = crxDatabase.Tables For Each crxDatabaseTable In crxDatabaseTables crxDatabaseTable.Location = App.Path & "\Database.mdb" crxDatabaseTable.SetLogOnInfo "Local", "Database.mdb", "Admin", "123456" Next Set crxSubreport = Nothing End If Next Next Frm_Preview.CR.ReportSource = CrxRep Frm_Preview.CR.ViewReport Frm_Preview.Show vbModeless, MainForm Set crxDatabase = Nothing Set crxDatabaseTable = Nothing Set crxDatabaseTables = Nothing Set crxSections = Nothing Set crxSection = Nothing Set crxSubreportObject = Nothing Set crxReport = Nothing Set crxApplication = Nothing End sub