Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Pass parameters from vb6 Post Reply Post New Topic
Author Message
zubairkhan
Newbie
Newbie
Avatar

Joined: 12 Nov 2007
Location: Pakistan
Online Status: Offline
Posts: 2
Quote zubairkhan Replybullet Topic: Pass parameters from vb6
    Posted: 14 Nov 2007 at 12:59am
Hi,   I designed a report which is attached with stored procedure, it has two date parameters, when i run program it generates error "The specified value type is different to the current value type". The codes are as follows

strStartDate = Format(RTrim(str(Year(dtStart.Value))), "0000") + "/" + Format(RTrim(str(Month(dtStart.Value))), "00") + "/" + Format(RTrim(str(Day(dtStart.Value))), "00")
    strEndDate = Format(RTrim(str(Year(dtEnd.Value))), "0000") + "/" + Format(RTrim(str(Month(dtEnd.Value))), "00") + "/" + Format(RTrim(str(Day(dtEnd.Value))), "00")

    CRT.StoredProcParam(0) = "@firstdate = '" & strStartDate & "';true"
    CRT.StoredProcParam(1) = "@lastdate '" & strEndDate & " ';true"
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 14 Nov 2007 at 12:35pm
You may want to try converting your strings to dates when you pass them to the parameters (assuming the paramters are not typed as strings). For example
 
CRT.StoredProcParam(0) = "@firstdate = '" & CDate(strStartDate) & "';true"
    CRT.StoredProcParam(1) = "@lastdate '" & CDate(strEndDate) & " ';true"
 
It may resolve the issue since it the error message seems to reflect a data type problem.
 
Hope this helps
 
Regards,
 
John W.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.033 seconds.