我是Crystal report 8.0初使用者,請問
我想從VB程中使用ADO 之RECORDSET來取得資料源,在crystalreport1之detail要印出fd1,fd2,fd3,請問在程式還要作什麼樣的敍述及crystalreport1中之fd1,fd2,fd3要如何定義這三個欄位,煩請指點迷津.
Dim cn1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim mysql As String
Dim dbpath As String
Dim Report As New CrystalReport1
dbpath = App.Path + "\acc.mdb"
mysql = "select fd1,fd2,fd3 from t02 where fd1 >100"
cn1.Open "provider=Microsoft.Jet.OLEDB.4.0;Data source=" & "'" & dbpath & "'"
rs1.CursorLocation = adUseClient
rs1.Open mysql, cn1, adOpenKeyset, adLockReadOnly
Report.Database.SetDataSource rs1
CrystalReport1.Section3 = "desp"
CRViewer1.ReportSource = Report
CRViewer1.ViewReport