Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass value from vb to store procedure,whic called by CR

Status
Not open for further replies.

nDAa

Programmer
Mar 1, 2005
14
TH
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


 
Hallo,

i think the problem is here:

conn = rptPrint.LogOnServer("p2ssql.dll", "SRVnme", "DBnme", "sa", "")

The system could not connect to p2ssql.dll; try give a full path & file name - like this:

DllName = "c:\winnt\system32\p2ssql.dll"
conn = rptPrint.LogOnServer(DllName, "SRVnme", "DBnme", "sa", "")

Try...

Lp,DaT
 
Hello All,

Thank you for solving and then I try your suggestions. The program can run but did not display data just appear the crystal form that I designed.

I run crystal report (report1.rpt) It's OK but when double click the execute file of report1. It's output same as call from VB. What wrong with this ?

Have any ideas and thanks for your help

Regards,
Ndaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top