hey,iam working on a software project on and am using this piece of code to generate a report from a SQL 2000 stored procedure using Vb 6.0 environment by passing a datetime parameter.i have used it before to generate the same report using Ms access and it has worked,but using the same in SQL it,s giving me an error.please if anyone has an idea of how i can solve the head ache problem am appreciating for your assistance.
Public Sub GenerateIn(thedate As Date)
check_RS2
rs2.Open "exec cin #" & thedate & "#", Cnn
With rptIn
Set .DataSource = rs2
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblDate" Then
.Item(i).Caption = thedate
End If
End If
Next i
End With
.Refresh
'Unload frmReports
.Show vbModal
End With
rs2.Close
End Sub
Public Sub GenerateIn(thedate As Date)
check_RS2
rs2.Open "exec cin #" & thedate & "#", Cnn
With rptIn
Set .DataSource = rs2
With .Sections("Section4").Controls
For i = 1 To .Count
If TypeOf .Item(i) Is RptLabel Then
If .Item(i).Name = "lblDate" Then
.Item(i).Caption = thedate
End If
End If
Next i
End With
.Refresh
'Unload frmReports
.Show vbModal
End With
rs2.Close
End Sub