How to pass parameters from VB6 to Crystal 9

1

At first I want to leave the note that is not my beach vb and crystal, I also had enormous difficulties in identifying the versions of the programs used to maintain this system. But in addition, for some years now I rarely have to touch it and I usually pick up a little 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 it has some reports developed in crystal.

I just installed crystal 8.5 and managed to edit the reports, and everything was OK by then.

But I had to create a new report and I did not 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 and I created the new report and updated the others to use the new crystal library. In crystal the reports work fine, in VB also but when I execute I am asked to pass the parameters, and this is done by the system, for the report to work. I've already broken my head, and nothing I've done was effective in resolving 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 ...

    
asked by anonymous 07.06.2017 / 21:04

0 answers