CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2001
    Posts
    3

    From VB6 code call a report designed in MS-Access

    I designed some report templates inside MS-Access 2000, so I'd like call and display them inside my program that written in Visual Basic 6.0. How to do this ?


  2. #2
    Join Date
    Sep 2001
    Location
    Little Rock, Arkansas
    Posts
    40

    Re: From VB6 code call a report designed in MS-Access

    I have never done this so I can't tell you how. But if this was my problem I would look at using the Microsoft Snapshot Viewer OCX as a possible solution.

    (While previewing this post, the following hyperlink did not highlight properly. You'll have to highlight it then cut-and-paste into your URL address bar)

    http://support.microsoft.com/directo...icle.asp?ID=KB;EN-US;Q175274


  3. #3

    Re: From VB6 code call a report designed in MS-Access

    '// Reference:- MS-Access 9.0 Object Library

    Dim appAccess As Access.Application
    Set appAccess = New Access.Application
    appAccess.OpenCurrentDatabase ("Path of your DB")
    appAccess.DoCmd.OpenReport "Report Name", acPreview, , strYourCriteriaOptional
    appAccess.DoCmd.OutputTo acOutputReport, "Report Name", acFormatSNP, "c:\temp.snp", True
    appAccess.Quit
    Set appAccess = Nothing

    '//The line with "c:\temp.snp" is where it will save the Snapshot, If you really want to save it, you can change the name and path.
    '// I save it to a temp file because I have no use for it, so it gets deleted each time I run a report.



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

Featured