Hi,
I'm new at Crystal Reports and I'm stuck.
I'm using Visual Basic to get the right data and then it's supposed to show the data in the report. The problem is that even if I put a "Where" condition in my SQL the report ignores the condition and shows ALL data! Can someone help me??
This is my code:
Private Sub Command1_Click
Dim strSQL as string
Dim strConnstring as string
strSQL = "Select * from kunder where kunder.land = 'Sverige'"
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\SOS\rapporter\test.mdb;Persist Security Info=False"
objConn.Open strConnString
rs.Open strSQL, objConn, adOpenDynamic, adLockBatchOptimistic
report.Database.SetDataSource rs
report.ReadRecords
CRViewer1.ReportSource = report
CRViewer1.ViewReport
End Sub
I'm new at Crystal Reports and I'm stuck.
I'm using Visual Basic to get the right data and then it's supposed to show the data in the report. The problem is that even if I put a "Where" condition in my SQL the report ignores the condition and shows ALL data! Can someone help me??
This is my code:
Private Sub Command1_Click
Dim strSQL as string
Dim strConnstring as string
strSQL = "Select * from kunder where kunder.land = 'Sverige'"
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\SOS\rapporter\test.mdb;Persist Security Info=False"
objConn.Open strConnString
rs.Open strSQL, objConn, adOpenDynamic, adLockBatchOptimistic
report.Database.SetDataSource rs
report.ReadRecords
CRViewer1.ReportSource = report
CRViewer1.ViewReport
End Sub