• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to connect crystal report with vb 6.0

M

Moses

#1
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 Computer

P

Paul Randall

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

> 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 Computer