Hi,
This is working fine for me.
now i want to put more than one query results on crystal report.
is it possible?because i want one result from 2 tables and one result from other 2 tables.
for example here i am giving one sql query result on crystal, same way i want
other query result on the same report.

VB Code:
  1. Dim db_conn As New ADODB.Connection
  2. Dim rs As ADODB.Recordset
  3. Private Sub Form_Load()
  4.    
  5.     Dim CRReport As CRAXDRT.Report
  6.     Dim CRApp As New CRAXDRT.Application
  7.    
  8.     'Open the Crystal Report
  9.     Set CRReport = CRApp.OpenReport("C:\Program Files\Microsoft Visual Studio\VB98\newreport\Report2.rpt")
  10.     Set rs = New ADODB.Recordset
  11.     db_conn.Open "Driver={Microsoft ODBC for Oracle};" & _
  12.     "Server=Test;" & _
  13.     "Uid=Scott;" & _
  14.     "Pwd=tiger"
  15.     Dim sqlq As String
  16.     sqlq = "Select empid from employee where empid like 'M4%'"
  17.     With CRReport
  18.         'Set the Access database path
  19.         .Database.Tables(1).Location = App.Path & "\MaData"
  20.         rs.Open sqlq, db_conn, adOpenStatic, adLockReadOnly
  21.          .Database.SetDataSource rs, 3, 1
  22.         CrystalActiveXReportViewer1.ReportSource = CRReport
  23.        CrystalActiveXReportViewer1.ViewReport
  24.   End With
  25.        
  26. End Sub

thank you
wizkid