Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Query: Printing MS access tables using VC++

Query: Printing MS access tables using VC++

Scheduled Pinned Locked Moved C / C++ / MFC
databasecsharpc++design
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ankush Mehta
    wrote on last edited by
    #1

    Hi All, Requirement: i want to print the table in an MS Access Database.The Design is such that when i select a database using open Dialog, the corresponding tables in it should come in combo box automatically,i.e, 1) I should be able to retrieve the no. of tables & their names as well(not resolved) 2)on selecting any 1 table in combo box, i want to automate its printing through the click of a button. i am using vc++ 6.0 & office 2000 Where i am: I tried a lot & searched a lot on net. a lot of material is available in vb/.net but in vc++ the same approach doesn't work out. Here is a snippet of the code: if(!app.CreateDispatch("Access.Application")) { AfxMessageBox("Couldn't CreateDispatch on Excel"); return; } // Set visible. app.SetVisible(TRUE); app.OpenCurrentDatabase(m_FileName,TRUE); //Get DoCmd Collection lpDisp=app.GetDoCmd(); ASSERT(lpDisp); // Attach the IDispatch pointer to the oDoCmd object oDoCmd.AttachDispatch( lpDisp ); //Parameters of Open Table & Printout shown below give errors in VC++ oDoCmd.OpenTable (TableName,acViewNormal,acReadOnly); DoCmd.PrintOut [printrange][, pagefrom, pageto][, printquality][, copies][, collatecopies] I don't know whether this is the desired approach to fulfill the 2 requirements mentioned above.Moreover, i don't know the desired parameters of opentable & printout in vc++(Preferably,they should be same as in vba but still these give errors. if possible, please give the exact parameters in any solution) This is urgent. Please Help. Thanks in anticipation, Ankush Mehta. Ankush Mehta

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups