Access table online synchronizing with same on desktop (


I have an 4 website application that has an Access database with 2 tables.
I have exactly the same database on my desktop and want to pull the data from my online
Access database tables into the tables on the Access database on my desktop. How would one do this? What code would I use. I have already written the code below to connect to my databse

Protected Sub Button_AllData_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button_AllData.Click
        '// define a connection to the database

        Dim cs As String = ConfigurationManager.ConnectionStrings("WhatEverNameYouWant").ConnectionString
        cs = cs.Replace("App_Data\GC.accdb", Server.MapPath("App_Data\GC.accdb"))

        Dim cn As New OleDbConnection(cs)

        '// define the sql statement to execute
        Dim cmd As New OleDbCommand("SELECT * FROM Performance", cn)


            '// open the connection

            '// execute the sql statement
            Using reader As OleDbDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)

                ' While reader.Read()
                '// this loops through all of the returned records
                'End While

                GridViewData.DataSource = reader

            End Using

        Catch ex As Exception

            If cn.State <> ConnectionState.Closed Then
            End If
        End Try
    End Sub

Open in new window

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jini JoseSenior .Net DeveloperCommented:
did u getting any errors ?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Your code above is used in an ASP.NET program. This ASP.NET program can connect to an Access database residing on the same server as the ASP.NET app, of course.

However, from your desktop you cannot remotely connect to an Access database. Generally speaking, unless you can navigate to the databsae using a typical Windows Explorer window, you're out of luck (there are some cases where directories are hidden and such, which allows you to connect without actually seeing those Access databases).

You can use methods to export/import data between your two databases. Those can be cumbersome and difficult to work with.

Or you can switch over to using a true server-type database that supports remote connections. SQL Server Express is a great starting point for this - it's free, easy to use and works very tightly with Access. You can set it up for remote connections, which means your local Access database could indeed connect to the web-based database.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks for the info ;)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.