Hi,All
I have a problem with vb6 pass value to store procedure,that called by crystal report(7.0)
as below is my code.
Store procedure:
create procedure PRN_VAT_RPT
@rpt_date varchar(10),
@company varchar(1)
as
select * from Tax_form
where comp_code = @company and tax_date = @rpt_date
VB code :
Private Sub cmdPRINT_Click()
Dim nparams, conn As Integer
rptPrint.ReportFileName = App.Path + "\reports\report1.rpt"
conn = rptPrint.LogOnServer("p2ssql.dll", "SRVnme", "DBnme", "sa", "")
nparams = rptPrint.RetrieveStoredProcParams
rptPrint.StoredProcParam(0) = ConvDate
rptPrint.StoredProcParam(1) = Trim(mbCompany)
rptPrint.Action = 1
End sub
and the report1.rpt connection with PRN_VAT_RPT procedure (by set location database)
when run program ,it display error message as :
Invalid file name.
there is any other way to do the same thing.
Any help is greatly appreciate.
Ndaa
I have a problem with vb6 pass value to store procedure,that called by crystal report(7.0)
as below is my code.
Store procedure:
create procedure PRN_VAT_RPT
@rpt_date varchar(10),
@company varchar(1)
as
select * from Tax_form
where comp_code = @company and tax_date = @rpt_date
VB code :
Private Sub cmdPRINT_Click()
Dim nparams, conn As Integer
rptPrint.ReportFileName = App.Path + "\reports\report1.rpt"
conn = rptPrint.LogOnServer("p2ssql.dll", "SRVnme", "DBnme", "sa", "")
nparams = rptPrint.RetrieveStoredProcParams
rptPrint.StoredProcParam(0) = ConvDate
rptPrint.StoredProcParam(1) = Trim(mbCompany)
rptPrint.Action = 1
End sub
and the report1.rpt connection with PRN_VAT_RPT procedure (by set location database)
when run program ,it display error message as :
Invalid file name.
there is any other way to do the same thing.
Any help is greatly appreciate.
Ndaa