Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Create report from Access2003

Question
I want to make a VB6 program wich uses a access2003 database (mdb file)(tables only). The question is, if I have table in that database, can I use them to create report and show it ? If so, how?

Thank you in advance.

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : Question
    : I want to make a VB6 program wich uses a access2003 database (mdb
    : file)(tables only). The question is, if I have table in that
    : database, can I use them to create report and show it ? If so, how?
    :
    : Thank you in advance.
    :
    :

    I believe VB allows you to add a report 'form' just as you would add another normal Form to the program.
    After that, you need to play around with properties and SQL statements.
    You probably also need to reference ADO or a similar library.

    I'm affraid I am not much good with databases, so I can't be more specific :(


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • CarterLangleyCarterLangley Member Posts: 29
    : Question
    : I want to make a VB6 program wich uses a access2003 database (mdb
    : file)(tables only). The question is, if I have table in that
    : database, can I use them to create report and show it ? If so, how?
    :
    : Thank you in advance.
    :
    :

    Try creating the report in Access and then just calling it from VB6, converting it to .rtf at the same time and then showing the word document.
  • dokken2dokken2 Member Posts: 532
    : : Question
    : : I want to make a VB6 program wich uses a access2003 database (mdb
    : : file)(tables only). The question is, if I have table in that
    : : database, can I use them to create report and show it ? If so, how?
    : :
    : : Thank you in advance.
    : :
    : :
    :
    there are several options, vb6 built-in data reports [my opinion more trouble than they are worth], a 3rd party reporting tool like crystal reports or activereports, or automate an access report [free if access is installed]

    ex:

    'reference needed-
    'microsoft access 10.0 object library
    Dim objAccAppl As Access.Application

    Private Sub Command1_Click()
    Set objAccAppl = GetObject(App.Path + "acc2000.mdb")
    objAccAppl.Visible = True
    objAccAppl.DoCmd.OpenReport "report1", acViewPreview ' acViewNormal
    End Sub

    Private Sub Command2_Click()
    objAccAppl.Quit acQuitSaveNone
    Set objAccAppl = Nothing
    End Sub
  • CarterLangleyCarterLangley Member Posts: 29
    : : : Question
    : : : I want to make a VB6 program wich uses a access2003 database (mdb
    : : : file)(tables only). The question is, if I have table in that
    : : : database, can I use them to create report and show it ? If so, how?
    : : :
    : : : Thank you in advance.
    : : :
    : : :
    : :
    : there are several options, vb6 built-in data reports [my opinion
    : more trouble than they are worth], a 3rd party reporting tool like
    : crystal reports or activereports, or automate an access report [free
    : if access is installed]
    :
    : ex:
    :
    : 'reference needed-
    : 'microsoft access 10.0 object library
    : Dim objAccAppl As Access.Application
    :
    : Private Sub Command1_Click()
    : Set objAccAppl = GetObject(App.Path + "acc2000.mdb")
    : objAccAppl.Visible = True
    : objAccAppl.DoCmd.OpenReport "report1", acViewPreview ' acViewNormal
    : End Sub
    :
    : Private Sub Command2_Click()
    : objAccAppl.Quit acQuitSaveNone
    : Set objAccAppl = Nothing
    : End Sub
    :

    Why not just use late binding and not specify access 10? Will still work?
  • dokken2dokken2 Member Posts: 532
    : : 'reference needed-
    : : 'microsoft access 10.0 object library
    : : Dim objAccAppl As Access.Application
    : :
    : : Private Sub Command1_Click()
    : : Set objAccAppl = GetObject(App.Path + "acc2000.mdb")
    : : objAccAppl.Visible = True
    : : objAccAppl.DoCmd.OpenReport "report1", acViewPreview ' acViewNormal
    : : End Sub
    : :
    : : Private Sub Command2_Click()
    : : objAccAppl.Quit acQuitSaveNone
    : : Set objAccAppl = Nothing
    : : End Sub
    : :
    :
    : Why not just use late binding and not specify access 10? Will still
    : work?
    :

    you could as well, was just the example i had in my files. there are tradeoffs between each method and this site gives a explanation-
    http://word.mvps.org/FAQs/InterDev/EarlyvsLateBinding.htm
  • CarterLangleyCarterLangley Member Posts: 29
    : : : 'reference needed-
    : : : 'microsoft access 10.0 object library
    : : : Dim objAccAppl As Access.Application
    : : :
    : : : Private Sub Command1_Click()
    : : : Set objAccAppl = GetObject(App.Path + "acc2000.mdb")
    : : : objAccAppl.Visible = True
    : : : objAccAppl.DoCmd.OpenReport "report1", acViewPreview ' acViewNormal
    : : : End Sub
    : : :
    : : : Private Sub Command2_Click()
    : : : objAccAppl.Quit acQuitSaveNone
    : : : Set objAccAppl = Nothing
    : : : End Sub
    : : :
    : :
    : : Why not just use late binding and not specify access 10? Will still
    : : work?
    : :
    :
    : you could as well, was just the example i had in my files. there
    : are tradeoffs between each method and this site gives a explanation-
    : http://word.mvps.org/FAQs/InterDev/EarlyvsLateBinding.htm

    That version independence is what I was after. I am using a machine with Office 2003, but some users have Office 2000 or earlier. If I used early binding and referenced Office 11, would it still have run without a problem on earlier versions of office? I think, seeing as my users are not power users, I should stick to late binding. But what are your views? I have been caught out with late binding for the reasons mentioned in that article.
Sign In or Register to comment.