1
At first I want to leave note that it is not my Vb beach and crystal, also had enormous difficulties in identifying the versions of the programs used to give maintenance to this system. But it’s been a few years since I’ve rarely had to touch it and I usually get a little bit but I do what has to be ugly.
I have the following scenario:
- Sql Server 2000 Database.
- The system is developed in the old vb6 "Jesus".
- And have some reports developed on Crystal.
I installed Crystal 8.5 and managed to edit the reports, and it was OK so far.
But I needed to create a new report and I couldn’t figure out how to create a report using procedures in Crystal 8.5, and that’s where I got lost. I installed Crystal 9 on it I created the new report and updated the others to use the new Crystal library. In Crystal the reports work well, in VB also put when I run I am asked to pass the parameters, and this is done by the system, for the report to work. I’ve broken my head, and nothing I’ve done has been effective in solving the problem.
Follow the code to see if anyone can help me.
Private Sub btn_boleto_Click()
If Trim(Me.COD_HISTORICO1.Caption) = "" Then
MsgBox "Selecione uma cobrança para imprimir o boleto.", vbInformation, "Atenção"
Exit Sub
End If
Dim STR_STATUS As String
With Me.Relatorio
.Connect = "UID=sa;PWD=#######;DRIVER={MICROSOFT ODBC FOR SQLSERVER};SERVER=(local)"
.ReportFileName = App.Path & "\Relatorios\Boleto.rpt"
.CopiesToPrinter = 1
.DiscardSavedData = True
.WindowBorderStyle = crptSizable
.WindowTitle = "Alsite - Boleto"
.WindowControlBox = True
.WindowState = crptMaximized
.RetrieveStoredProcParams
.StoredProcParam(0) = "45"
.Destination = crptToWindow
.Action = 1
End With
End Sub
o grande problema está nas linhas:
.RetrieveStoredProcParams
.StoredProcParam(0) = "45"
*já tirei a primeira
*já mudei a segunda
StoredProcParam("@Nome_parametro") = 45
ParameterFields(0).AddCurrentValue 45
ParameterFields(0).AddCurrentValue = 45
ParameterFields("@Nome_parametro").AddCurrentValue 45
ParameterFields("@Nome_parametro").AddCurrentValue = 45
ParameterFields(0) = "@Nome_parametro;45;TRUE"
and so on...