|
|||||||
| Programming, Coding, (Web)Design Discuss all your programming or design needs with likeminded people. |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
DriverHeaven Junior Member
Join Date: Sep 2003
Location: Kuching
Posts: 31
Rep Power: 0 ![]() |
Printing in VB6
Hi guys,
i would like to know if there's any way that i can print a database which is stored in MS Access 97 format. Help me with the code please.
|
|
|
|
|
|
#2 |
|
A Legend in Underwear
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0 ![]() |
Any reason why you can't print using MS Access?
__________________
Gentoo Linux - Developer (baselayout) Read my blog "I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours." Stephen Roberts |
|
|
|
|
|
#3 |
|
DriverHeaven Senior Member
Join Date: Dec 2004
Location: Inside DriverHeaven
Posts: 856
Rep Power: 0 ![]() ![]() |
How do you connect to the database? I presume via ADO, right? (I assume you have connected to the database somehow)
Do you want to print your database via Crystal Reports (which is easier, but requires Crystal Reports to be installed) or manually? For an introduction to ADO, check here: http://www.officecomputertraining.co...ges/page37.asp Have a look at a reference to the ADO object here: http://www.w3schools.com/ado/ado_ref_connection.asp and here: http://www.carlprothman.net/Default.aspx?tabid=81 and check here on how to filter your data: http://support.microsoft.com/default...b;en-us;244779
__________________
|
|
|
|
|
|
|
|
DriverHeaven Junior Member
Join Date: Sep 2003
Location: Kuching
Posts: 31
Rep Power: 0 ![]() |
The reason i don't directly print with MS Access is because it's a school project. The VB program is supposed to print whatever is listed in the database as a report. Actually I don't think I use ADO (if I'm not mistaken). I use something like this:
E.g. Private Sub lvwContacts_Click() Set rs = db.OpenRecordset("Contacts") While Not rs.EOF If lvwContacts.SelectedItem.Text = rs!ContactID Then txtCName.Text = rs!Nam Private Sub Form_Load() Set db = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\mydata.mdb") |
|
|
|
|
|
#5 |
|
A Legend in Underwear
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0 ![]() |
VB normally comes with Crystal Reports - look into using that instead as it's the perfect reporting tool for the job
__________________
Gentoo Linux - Developer (baselayout) Read my blog "I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours." Stephen Roberts |
|
|
|
![]() |
| Thread Tools | |
|
|