A good way to run MicrosoftAccess report in VB

Source: Internet
Author: User

In VB how to use intuitive, simple report has been a lot of people concerned about the problem, crystalreports use is not very ideal. This paper introduces a method of running MicrosoftAccess report in VB, which is good to use.

Using Automation to run MicrosoftAccess reports

1. Use MicrosoftAccess to establish a database (e.g., NOVELTY.MDB) related reports (such as: rptemployess).

2. Create a reference

Use the "Projectreferences" menu in VB to create a reference to Microsoftaccess8.0objectlibrary.

3. List of procedures

' Referencesmsaccess8.0objectlibrary (this

' Codewillworkwithanyversonofaccessthat

' Supportsautomation)

Dimmsaccessasaccess.application

Privatesubcommand1_click ()

Setmsaccess=newaccess.application

Msaccess.opencurrentdatabase (app.path& "Ovelty.mdb")

MSAccess.DoCmd.OpenReport "Rptemployess", acViewNormal

Msaccess.closecurrentdatabase

Setmsaccess=nothing

Endsub

Note: acViewNormal tells access to open the report and print it immediately.

The disadvantage of this approach is that the operating environment must be fitted with msaccess. ->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.