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. Database & SysAdmin
  3. Database
  4. ADO and JRO question

ADO and JRO question

Scheduled Pinned Locked Moved Database
questionc++comjsontutorial
2 Posts 1 Posters 7 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.
  • R Offline
    R Offline
    Roger Cornell
    wrote on last edited by
    #1

    I have a need to replicate and synchronize an .mdb file in VC++ 6.0. I see that the JRO contains CreateReplica() and Synchronize() methods, these are precisely what I need to do. What I need to know is how to create the Replica object, I've seen reference to IReplica in the msjro.tlb file but I'm not sure what is the Replica equivalent of _ConnectionPtr. Once I know how to create the Replica object the rest should fall into place. Roger Cornell

    R 1 Reply Last reply
    0
    • R Roger Cornell

      I have a need to replicate and synchronize an .mdb file in VC++ 6.0. I see that the JRO contains CreateReplica() and Synchronize() methods, these are precisely what I need to do. What I need to know is how to create the Replica object, I've seen reference to IReplica in the msjro.tlb file but I'm not sure what is the Replica equivalent of _ConnectionPtr. Once I know how to create the Replica object the rest should fall into place. Roger Cornell

      R Offline
      R Offline
      Roger Cornell
      wrote on last edited by
      #2

      I've got a solution for my own question now, here it is. I've found out how to create a replica of an Access .mdb file through VC++. Here's the code. This code goes at the end of STDAFX.H #import "C:\\program files\\common files\\system\\ado\\msado21.tlb" \ no_namespace \ rename("EOF", "adoEOF") #import "C:\\program files\\common files\\system\\ado\\msjro.dll" MSJRO.DLL uses a namespace JRO. This code goes in a .CPP file CoInitialize(NULL); JRO::IReplicaPtr m_pReplica; HRESULT hr0; hr0 = m_pReplica.CreateInstance(__uuidof( JRO::Replica ) ); if(SUCCEEDED(hr0)) { CString m_connectString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\\JDOCS\\Data\\JDOCS.mdb"; m_pReplica->PutActiveConnection(_bstr_t(m_connectString)); CString m_repName = "D:\\JDOCS\\Data\\JDOCSRep2.mdb"; CString m_repDesc = "JDOCS Database Replica"; m_pReplica->CreateReplica(_bstr_t(m_repName), _bstr_t(m_repDesc), JRO::jrRepTypeFull, JRO::jrRepVisibilityGlobal, -1, JRO::jrRepUpdFull); } CoUninitialize(); Roger Cornell

      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