title: How to connect a database to crystal report at run time?
body: <p>I am developing winform application in vb6. I am using crystal report 4.6. I have created a crystal report which shows all data from a table (MS Access).  And I unchecked save data with report and i saved the report. I just want to invoke it in application. So I included the component CrystalReportControl in my application. Now i want to set the records to be displayed in the report. The records are selected according to the user input to the text box.
  Records are retrived from the database is done in following code.</p>
  
  <pre><code>    Dim conn As ADODB.Connection
      Dim rs As ADODB.Recordset
      Private Sub Command1_Click()
        Set conn = New ADODB.Connection
        conn.Open "provider=Microsoft.jet.oledb.4.0;Data Source=" &amp; App.Path &amp;"\faculty.mdb"
        Set rs = New ADODB.Recordset
        rs.Open "select * from facultydetails where eid=1234", conn, adOpenDynamic, adLockPessimistic
        CrystalReport1.ReportFileName = App.Path &amp; "\faculty.rpt"
        Set CrystalReport1.DataSource = rs
        CrystalReport1.Action = 1
      End Sub
  </code></pre>
  
  <p>Gives an error for the line: Set CrystalReport1.DataSource = rs :
  as Property is write-only.
  Tell me how the records of the report can be dynamic? Plz help me...</p>