Home > How-To Library > Database

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

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
'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

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.