अपने दैनिक जीवन मे प्रोगामिग सम्बंधी जो समस्या, वो क्या है कैसे हुई और मै ने उसका क्या समाधान किया |
Monday, July 18, 2011
How to Create a DataReport by Recordset?
Inculcated References file : Microsoft ActiveX Data Objects 2.0 Library
Using Module
Option Explicit
Public cn As New ADODB.Connection
Sub Main()
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\NWIND.mdb;Persist Security Info=False"
cn.Open
Form1.Show
End Sub
Using Form
Option Explicit
Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
rs.ActiveConnection = cn
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseServer
rs.Open "SELECT * FROM Customers"
If rs.RecordCount > 0 Then
Set DataReport1.DataSource = rs
DataReport1.Show
End If
End Sub
Using DataReport
In Detail section
Use a text box and it's Properties DataField :CompanyName
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment