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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My report doesn't show the right data!

Status
Not open for further replies.

lotwal01

Programmer
Nov 8, 2001
30
SE
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top