CodeItBetter Programming Another VB Programming Blog

How to print Data Base Records from your VB Application Or Even from Data present in MSFlexgrid Control.

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'Database - How to print Data Base Records from your VB Application Or Even from Data present in MSFlexgrid Control.
'Define myConn and myRec for Connection and RecordSet

Private Sub Form_Load()
    Dim myConn As ADODB.Connection
    Dim myRec As ADODB.Recordset
 
    Set myConn = New ADODB.Connection
    Set myRec = New ADODB.Recordset
 
    myConn.Open ""    'Your Data base name
    myRec.Open    'Open Record Set

    While myRec.EOF <> True
        Printer.Print myRec.Fields(0), myRec.Fields(1)
        Printer.EndDoc
        myRec.MoveNext
    Wend
End Sub

Related posts:

  1. How to use ADO to load data into a FlexGrid control
  2. How to Use ADO to get data from a read-only Access database
  3. How to Read Image from Data Base which is stored in Binary format.
  4. How to Connect to a data source using ADO and retrieving the data.
  5. How to connect Oracle from VB
  6. How to use a INSERT INTO statement in ADO to copy data from one table into two existing tables
  7. How to Use ADO to page through records 10 at a time
  8. How to construct a Recordset of Contacts info from Outlook
  9. How to Use ADO to populate a ListBox with data values
  10. How to Use ADO to list database tables and their records in a TreeView

Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.