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
Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.