Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How to connect crystal report with vb 6.0

Reply
 
Old 03-10-2009   #1 (permalink)
Moses


 
 

How to connect crystal report with vb 6.0

Hi, Can you please help me with the step by step of connecting crystal report
with vb 6.0. I tried to include CrystalPrintControl on the project and add
the following code but gives me errors:

Option Explicit
Private m_objRS As New ADODB.Recordset
Private m_objReport As CRAXDRT.Report
Private m_objApp As New CRAXDRT.Application

Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim strSQL As String

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Program
Files\VB98\NWIND.MDB"

strSQL = "Select * From Customers"

m_objRS.CursorLocation = adUseClient
m_objRS.Open strSQL, cn, adOpenStatic

Set m_objReport = m_objApp.OpenReport("F:\MyReport.rpt", 1)
With m_objReport
.Database.SetDataSource m_objRS, 3, 1
.DiscardSavedData
.ReadRecords
End With

With CRViewer1
.ReportSource = m_objReport
.ViewReport
End With

m_objRS.Close
Set m_objRS = Nothing

cn.Close
Set cn = Nothing
Set m_objReport = Nothing
Set m_objApp = Nothing
End SubIn this example I'm using

My System SpecsSystem Spec
Old 03-10-2009   #2 (permalink)
Paul Randall


 
 

Re: How to connect crystal report with vb 6.0


"Moses" <Moses@xxxxxx> wrote in message
news:46488463-3727-467B-92E3-184A977A13BB@xxxxxx
Quote:

> Hi, Can you please help me with the step by step of connecting crystal
> report
> with vb 6.0. I tried to include CrystalPrintControl on the project and add
> the following code but gives me errors:
This newsgroup is named microsoft.public.scripting.vbscript.
VB6 is NOT vbscript.
Why not try a newsgroup with VB and CRYSTAL in it name, like
microsoft.public.vb.crystal?
Also, now that you know that there is a group with this name, you might
try a groups.google.com search of that specific group.
In the groups.google.com search box, type the following:
crystal report vb6 group:microsoft.public.vb.crystal

The first hit I get is How to use crystal report in VB6

-Paul Randall


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
CRystal report Visual basic 2005 .NET General
Changing Crystal Report data source to a function .NET General
Crystal report crash with exotic font .NET General
V.Studio 2003 - unable to edit Crystal Report .NET General
Re: Passing Parameters to a Crystal Report with a Subreport .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46