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

Read Crystal Tables

Status
Not open for further replies.

tc3596

Technical User
Mar 16, 2001
283
Is it possible for me to read a crystal file and have it tell me the tables and/or database involved within VB6?
 
Yes, if you have the Report Design Component installed.

Include it as one of your references (CRAXDRT.DLL)

Code:
    Dim CrApp1 As Application
    Dim CrRep As Report
    Dim CrDB As Database
    Dim CrTables As DatabaseTables
    Dim CrTable As DatabaseTable
    
    Set crApp1 = New Application
    Set CrRep = CrApp1.OpenReport("c:\crystal\myreport.rpt")
    Set CrDB = CrRep.Database
    Set CrTables = CrDB.Tables
    Set CrTable = CrTables.Item(1)

This should give you all the objects needed to find out what you need to know.

--NipsMG s-)
 
Correction!:

To avoid confusion between different ADO/RDO and its objects, make sure you use the following:

Code:
    Dim CrApp1 As CRAXDRT.Application
    Dim CrRep As CRAXDRT.Report
    Dim CrDB As CRAXDRT.Database
    Dim CrTables As CRAXDRT.DatabaseTables
    Dim CrTable As CRAXDRT.DatabaseTable


--NipsMG s-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top