Проблема следующая: хочу в приложении на VB6 использовать Crystal Reports 8,5. Написал rpt-шник, а как его теперь подключить? Пробую так:
Dim rpt As CRAXDDRT.Report
Dim crx_app As New CRAXDDRT.Application
Private Sub Form_Load()
Dim comm As ADODB.Command
Set rpt = crx_app.OpenReport(Main_sub.Path_work & "pred_pog.rpt")
rpt.ReportTitle = "Отчет"
Set comm = New ADODB.Command
pClass.p_con.Open pClass.p_StrCon, pClass.p_User, pClass.p_Pass
Set comm.ActiveConnection = pClass.p_con
comm.CommandText = "execute my_proc 1, 1, '" & Format(Main_sub.p_Date_tek, "yyyymmdd") & "', 1"
comm.CommandType = adCmdText
rpt.Database.AddADOCommand pClass.p_con, comm
rpt.DiscardSavedData
rpt.EnableParameterPrompting = False
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Тогда на строчке rpt.Database.AddADOCommand pClass.p_con, comm
выдает окошко для выбора таблицы или набора SQL запроса, но даже если набирать, то пишет: "Server not yet opened"
Пробовал вставлять строчку:'rpt.Database.LogOnServer "p2ssql.dll", pClass.p_Server, pClass.p_Base, pClass.p_User, pClass.p_Pass
ничего не изменилось...
Есть у кого нибудь рабочий примерчик для подключения rpt, связанного со Stored Procedure SQL сервера?