Can I use JRO with .Net?

Posted on 2005-03-23
Medium Priority
Last Modified: 2012-08-13
I have a replicated Access Database that I will need to be able to synchronize.  I know that Access using JRO to manage the synchronization.  Am I able to use JRO with .NET.  If not, can anyone point me in the right direction to find some material to explain how to handle the synchronization.

On a side note, what I am doing is rebuilding the frontend of the application to get it out of Access.  I don't necessarily have to use Access as a backend.  What I do have to do is make the data accessable on and off the network.  Most of the time it will be used in the office; however, the application will need to be able to run on several laptops at remote locations where they will not have access to the internet.  I will need to insure the data's integrity and have some way to synchronize the information when the laptops are back on the network.

Currently, I was looking for a solution that would keep the same backend.  If someone knows how to accomplish this using a different backend and can help me personally or point me to the information I will need to come up with a working solution I will also accept that.

Thank you,
Kevin McBrearty
Question by:kmcbrearty
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 13621182
This article uses JRO to compact and repair Access, it may help you to accomplish what you are looking for

Author Comment

ID: 13746033

mnasman that really isn't helping me.


Author Comment

ID: 13952885

I have created code using VB.NET.  The following is the VB.NET code that was used and works.  

Imports System
Imports System.Windows.Forms
Imports JRO
Imports JRO.SyncTypeEnum
Imports JRO.SyncModeEnum

Module JROSync

    Function Synchronize(ByVal DB1 As String, ByVal DB2 As String)

        Call TwoWayDirectSync(DB1, DB2)

    End Function

    Sub TwoWayDirectSync(ByVal strReplica1 As String, _
    ByVal strReplica2 As String)
        Dim repReplica As New JRO.Replica
        Dim DBConnection As ADODB.Connection
        Dim strDBConnection As String

            ' Open connection
            strDBConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strReplica1 & ";"
            DBConnection = New ADODB.Connection

            repReplica.ActiveConnection = DBConnection

            ' Sends changes made in each replica to the other.
            repReplica.Synchronize(strReplica2, jrSyncTypeImpExp, jrSyncModeDirect)

            repReplica = Nothing
            MessageBox.Show("Synchronization Complete", "Synchronize Database", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "An Error has Occured", MessageBoxButtons.OK, MessageBoxIcon.Error)
            DBConnection = Nothing
        End Try

    End Sub

End Module

You have to add a reference to your project to the Microsoft Jet and Replication objects 2.6 library for it work.  If you want to rewrite this code for C# I will go ahead and award you the points.  Otherwise, I recommend that the points be refunded as the above link did not answer the question, it only works for compacting a database which is not what I wanted to accomplish.  I apologize for just now getting back to this but my wife was having some health problems and I haven't had much time to work on it.

Accepted Solution

PAQ_Man earned 0 total points
ID: 13972811
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question