Results 1 to 7 of 7

Thread: Can VB call an access report?????????

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    32

    Talking

    My database is in Access, so can my vb program call an Access report??????? If it's possible, how is it done? Someone help me purrleease..........

  2. #2
    Lively Member
    Join Date
    Oct 1999
    Location
    -
    Posts
    101
    If you want to print a report created in MS Access
    using your VB application, then its your lucky day.

    I've got this in this forum... but forgot the thread no.
    or the person who send it. Many of us tried this... and
    this really work. here's the code:


    ' From the book Database Access With VB6
    ' by Jeffery Mcmanus..
    ' you need your access ref obj lib

    Dim MSACCESS as Access.application

    Private Sub PrintReport_Click()

    Set MSACCESS = New Access.Application

    MSACCESS.OpenCurrentDatabase ("c:\your dir\Your.mdb")
    'This opens your db..

    MSACCESS.DoCmd.OpenReport "YourReportHere", acViewNormal
    'This actualy opens your report from your Access (97?)
    'db & then prints it..

    MSACCESS.CloseCurrentDatabase ' self explanitory

    Set MSACCESS = Nothing
    ' You need this,
    ' or you will keep access in memory & lag the user..
    icq: 16228887

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The above only works if the machine the program is running on has Access installed, if that matters to you.

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    32
    thanks a million rod for the codes. u too edneeis.
    yup... there's access installed in the machine. But just for curiosity, what if access resides in the server???

  5. #5
    Lively Member
    Join Date
    Jul 2000
    Posts
    104
    You can create the object on the server by using the CreateObject function.

    CreateObject(class,[servername])

    MSDN -- CreateObject Function:
    http://msdn.microsoft.com/library/de...eateObject.htm

  6. #6

    Post

    If you don't have Access installed on the target machine, you can use a product from Videosoft called VS Reports
    It is an add in OCX control that lets you distribute an app with Access reports to clients who don't have Access installed...

    It works pretty well on the one app I have tried it on here at work.
    ~Michael Kizer
    http://Michael.Kizer.ws

    The Ivory Gate Of Dreams ~ http://www.ivorygate.com

  7. #7
    Guest

    Why not VB reports?

    Liz, why didn't you just use the reporting capability of VB?

    Another neat trick is to report the data in HTML format. That way the results could be posted to a shared drive for all (at least those with a browser and access to the drive) to see. That could save a lot of trees from being sacrificed to the report gods.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width