Yup...
Ada sedikit pencerahan yang mudah dipraktekkan...
1. Coba bikin ODBC yang konek ke databasenya...
2. Bikin Query SQL-nya di database Access-nya...
3. Sample Codingnya di VB 6.0 :
======================================================================
Option Explicit
Dim App As CRPEAuto.Application
Dim rpt As CRPEAuto.Report
Dim prms As CRPEAuto.ParameterFieldDefinitions
Dim db As CRPEAuto.DataBase
Private Sub Cmd_Print_Click()
On Error GoTo Err_Print
Set App = New CRPEAuto.Application
Set rpt = App.OpenReport("E:\PRIMER\REPORT\ListJual.rpt") 'diisi
dengan absolut path ke Main Report
Set prms = rpt.ParameterFields
prms(1).SetCurrentValue DTP_StartDate.Value 'contoh passing
parameter ke Main Report
prms(2).SetCurrentValue DTP_EndDate.Value 'contoh passing
parameter ke Main Report
Set db = rpt.DataBase
db.Tables(1).SetLogOnInfo "PRIMER", "E:\PRIMER\DATABASE\KOPIN.MDB"
'login ke SQL Server dengan user dsn ACC, database ACCOUNTING, user =
sa, bisa disesuaikan dengan kebutuhan anda
rpt.Preview
Exit Sub
Err_Print:
MsgBox Error & Err.Number & Err.Description
End Sub
======================================================================
Mudah2x an membantu...
Salam,
Indrayana MB.
--- In [email protected], "lutfi" <[EMAIL PROTECTED]> wrote:
>
> dear all,
> dibawah ini source untuk report, dan koneksinya langsung ke
database, kalo mau menggunakan ODBC cara ubahnya gimana ya.......
>
> Private Sub isButton1_Click()
> With Form1.crFaktur
> .DataFiles(0) = App.Path & "\database.mdb"
> .ReportFileName = App.Path & "\Report\LapFaktur.rpt"
> .RetrieveDataFiles
> .UserName = "admin"
> .Password = "password" & Chr(10) & "password"
> .SelectionFormula = "{PENJUALAN.NoNota}='" & Me.Combo1.Text & "'"
> If Me.Option3.Value = True Then
> .Destination = crptToWindow
> Else
> .Destination = crptToPrinter
> End If
> .Action = 1
> .PageZoom (89)
> End With
> End Sub
>
> terima kasih
>
> [Non-text portions of this message have been removed]
>
--
www.itcenter.or.id - Komunitas Teknologi Informasi Indonesia
Gabung, Keluar, Mode Kirim : [EMAIL PROTECTED]
## Jobs: itcenter.or.id/jobs ## Bursa: itcenter.or.id/bursa ##
## Jaket ITCENTER tersedia di http://shop.itcenter.or.id
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ITCENTER/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ITCENTER/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/