DOS Mode Printing from VB

Category:
Miscellaneous
Type:
Applications
Difficulty:
Intermediate

Author: Anonymous

Version Compatibility: Visual Basic 6, Visual Basic 5, Visual Basic.NET

More information:
This Demo project shows how to print in DOS mode from your VB Application. It is helpfull in billing application. To get started, add a project reference to Microsoft ActiveX Data Objects 2.0 Library. Then copy the Northwind database into the current folder or change the path in the code. Finally, add two Command buttons named cmdReportGenerate and cmdPrint. Be sure you have a printer attached to your LPT1 port as this example uses redirection to PRN.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: