Results 1 to 7 of 7

Thread: Print access database

  1. #1

    Thread Starter
    Addicted Member Redangel's Avatar
    Join Date
    Oct 2005
    Location
    England
    Posts
    214

    Red face Print access database

    how do i print a access database ???? without showing the program access if possible

    thanks in advance RedAngel

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Print access database

    What do you want to print? Report, Form, etc. Are you doijng this from within Access VBA or from VB6?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: Print access database

    Hi,

    Are you referring to the database schema/metadata? or the objects of the database as what RD stated...

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  4. #4

    Thread Starter
    Addicted Member Redangel's Avatar
    Join Date
    Oct 2005
    Location
    England
    Posts
    214

    Re: Print access database

    all feilds in the database from vb6

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Print access database

    Create a Report in Access and then just DoCmd.OpenReport passing the report name and the hidden viewstate.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: Print access database

    Hi,

    Are you referring the values of the fields in the table? or the database schema?

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Print access database

    You can use ADOX for that purpose: set references to regulatar ADO and ADO Ext. 2.x for DDL and Security and run the following code.
    NOTE: you will have to provide fully qualified connection string for your database:
    VB Code:
    1. Private Sub Command3_Click()
    2. '============================
    3. Dim tbl As ADOX.Table
    4. Dim cat As ADOX.Catalog
    5. Dim con As ADODB.Connection
    6. Dim i%
    7.  
    8. On Error Resume Next
    9.  
    10.     Screen.MousePointer = vbHourglass
    11.    
    12.     Set con = New ADODB.Connection
    13.     con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\biblio.mdb;"
    14.    
    15.     Set cat = New ADOX.Catalog
    16.     Set cat.ActiveConnection = con
    17.    
    18.     For Each tbl In cat.Tables
    19.         Debug.Print String(24, "-")
    20.         Debug.Print tbl.Name
    21.         Debug.Print String(24, "-")
    22.         For i = 0 To tbl.Columns.Count - 1
    23.             Debug.Print tbl.Columns(i).Name
    24.         Next i
    25.         Debug.Print vbNewLine
    26.     Next
    27.    
    28.     Set cat = Nothing
    29.     con.Close
    30.     Set con = Nothing
    31.    
    32.     Screen.MousePointer = vbDefault
    33.  
    34. End Sub

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