HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > Software / Tools > Programming, Coding, (Web)Design


Programming, Coding, (Web)Design Discuss all your programming or design needs with likeminded people.

Reply
 
Thread Tools
Old Jul 27, 2005, 10:53 AM   #1
DriverHeaven Junior Member
 
Join Date: Sep 2003
Location: Kuching
Posts: 31
Rep Power: 0
as_izaak is on a distinguished road

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.
as_izaak is offline   Reply With Quote


Old Aug 1, 2005, 02:38 PM   #2
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

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
UberLord is offline   Reply With Quote
Old Aug 1, 2005, 08:15 PM   #3
md5
DriverHeaven Senior Member
 
md5's Avatar
 
Join Date: Dec 2004
Location: Inside DriverHeaven
Posts: 856
Rep Power: 0
md5 has a spectacular aura aboutmd5 has a spectacular aura about

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
__________________
md5 is offline   Reply With Quote
Old Aug 2, 2005, 01:55 PM Threadstarter Thread Starter   #4
DriverHeaven Junior Member
 
Join Date: Sep 2003
Location: Kuching
Posts: 31
Rep Power: 0
as_izaak is on a distinguished road

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")
as_izaak is offline   Reply With Quote
Old Aug 9, 2005, 12:18 PM   #5
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

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
UberLord is offline   Reply With Quote
Reply

Thread Tools