DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: VB6 with CR 8.5 Error: Connection Not Open

  1. #1
    Join Date
    Dec 2010

    Question VB6 with CR 8.5 Error: Connection Not Open

    I have a VB6 application that prints a CR Report. I have created a database table in SQL Server 2000 that is used only for field mapping/formatting.

    I created the bound fields in the report from the table, and I create a recordset from the table (empty).

    Then I add records to the recordset within the program from stored objects and set the datasource of the report to the recordset.

    When I try to view the report i get the error: "ODBC error: [Microsoft][ODBC Driver Manager] Connection Not Open"

    Here is the code that I use:
    dim iRS as ADODB.Recordset
    set iRS = [DataConnect object].GetDisconnectedRecordset("SELECT * FROM tblItemsReportFormat") '--this function just returns a disconnected recordset from the already connected datasource within the program
    dim oRpt as CRRptLouver '-- the CR Report
    set oRpt = new CRRptLouver
    dim crItems as CRAXDDRT.Report
    set crItems = oRpt.OpenSubreport("rptItems")
    crItems.Database.SetDataSource iRS,3,1
    dim rptForm as frmReport
    set rptForm = new frmReport
    rptForm.CRViewer1.ReportSource = oRpt 
    rptForm.CRViewer1.ViewReport '-- Here is where the error occurs
    Last edited by Hack; 12-28-2010 at 12:17 PM. Reason: Added Code Tags

Similar Threads

  1. VB6 Won't Open Access DB
    By wisgro in forum VB Classic
    Replies: 6
    Last Post: 11-01-2009, 12:45 PM
  2. Open source projects, open source resources
    By Anonymous in forum Open Source
    Replies: 0
    Last Post: 01-29-2002, 10:41 PM
  3. Replies: 3
    Last Post: 07-21-2001, 02:32 PM
  4. Replies: 24
    Last Post: 02-09-2001, 01:18 PM
  5. Com Interop and VB6 Collections
    By Esmond Hart in forum .NET
    Replies: 2
    Last Post: 01-29-2001, 07:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center