p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

crystal_reports thread: Query Info?

Message #1 by sheraz_aries@s... on Thu, 20 Feb 2003 03:55:42
Private Sub Form_Load()

Dim Report As New CrystalReport1
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset

Set con = New ADODB.Connection

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path 
& "\biblio.MDB;Persist Security Info=False" ' Open the connection
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "SELECT Authors.author,Titles.[Year Published] from Authors,Titles 
where Authors.AU_ID = 1207 and Authors.AU_ID=Titles.AU_ID", con
t = rs.RecordCount
'con.Execute ("select author from authors")
Report.Database.SetDataSource rs
CRViewer1.ReportSource = Report

End Sub

  Return to Index