473,237 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

Copying from MSSQL -> Access through datasets

Hi all,

We have 2 databases that are not connected to each other directly.
Changes to either databases can only be done on one side.
Those 2 databases are of the type MSAccess or MSSQL but with the same

So if something changes ( added,updated,deleted ) in Database 1 this
should be replicated through a webservice to Database 2.
I was thinking to make a kind of sourcesafe where you can check-in &
check-out the database ( state will be held on webservice-server ).
And with every check-in, a 'changeset' would be send to the webservice-
server so that the other side can download it.
Those 'changesets' would consist of 3 type of data per table :
- Deleted rows ( only hold the id's in this list )
- Inserted rows ( contains full dataset for new records )
- Updated rows ( contains full dataset for updated records )

For the first two I already found out how I should do this but the
updated rows are a problem.
The updated rows are always added as new rows instead of updated rows.

The code follows here :

Dim myConnectionSQL As New OleDbConnection
Dim myDataAdapterSQL As OleDbDataAdapter = New
OleDbDataAdapter("Select * From TEST..Export", myConnectionSQL)

Dim myConnectionAccess As New OleDbConnection
Dim myDataAdapterAccess As OleDbDataAdapter = New
OleDbDataAdapter("Select * From Export", myConnectionAccess)
Dim builder As OleDbCommandBuilder = New
Dim myDataSet As New DataSet
Dim myDataSet2 As New DataSet

myConnectionSQL.ConnectionString = "Provider=SQLOLEDB;Data
Source=(local);Integrated Security=SSPI"
myDataAdapterSQL.AcceptChangesDuringFill = False
myDataAdapterSQL.Fill(myDataSet, "Export")
MsgBox("Source table " &
myDataSet.Tables(0).TableName.ToString & " has " &
myDataSet.Tables(0).Rows.Count.ToString & " rows")

myConnectionAccess.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\test.mdb"


myDataAdapterAccess.Update(myDataSet, "Export")

What am I doing wrong here ?
Do you maybe have a better solution to synchronise 2 databases with
each other through a webservice ?

Thnx in advance ...
Sven Peeters

Sep 10 '07 #1
0 1057

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: badz | last post by:
Hi frenz Lately I try to use MSSQL and PHP , the problem arise when PHP try to read MSSQL field with 'image' data type, header("Content-type: image/jpeg"); // act as a jpg file to browser I...
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
by: Jim Davidson | last post by:
I have two databases A & B, I copied all of the tabels and data from A to B. I can't figure out how to copy the Views and Stored procedures from A to B. As you can see I'm new at this, can anyone...
by: Caroline | last post by:
I need to update a table by copying a column from another table (having the same structure, but on another database), from the record having the same primary key. 1 - What is the correct...
by: gharmel | last post by:
I'm trying to get some clues on why I get (much) slower responses from my PHP applications when dealing with a remote sql server as opposed to a local sql server. Here's my situation: Server...
by: ralphie | last post by:
hi all since nearly 2 days i fight with mssql and utf-8 as i need to store and retrieve arabic characters. i tried the com approach ...
by: php-taz | last post by:
I built a PHP website on Windows 2000 (using IIS) that connects to a SQL Server 2000 database using the mssql functions. I migrated the website and the database onto a Windows 2003 machine, and...
by: Derftics | last post by:
Hi Guys, Is there anyone who have tried installing MSSQL 2000 and MSSQL 2005 servers in one desktop computer? I have tried using MSDE and successfully install the MSSQL 2000 server but when I...
by: Olegus | last post by:
Hello, in order to perform backup/restore MSSQL database using SMO, one needs to reference several namespaces in a backup class : using Microsoft.SqlServer.Management.Common; using...
by: johnyjj2 | last post by:
Hello! I've got web application written in MSSQL and I need to run it on server. But on the server I've go MySQL (not MSSQL), PHP, KFWS. Do I have to install MSSQL and have both MySQL and MSSQL?...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.