Coding an app to use ActiveSync to sync between SQL CE and SQL 2000 / MSDE

P

Paul Aspinall

Can anyone provide any pointers or code examples for Coding an app to use
ActiveSync to sync between SQL CE and SQL 2000 / MSDE

I want the app to use ActiveSync and to be a Windows form app on the PC and
with a widest target platform (ie. XP home, so no IIS), therefore using IIS
for Sync is not really an option (?)

Thanks
 
P

Paul G. Tobey [eMVP]

You really wouldn't do it that way. There's no 'file' to be synchronized.
If you have an intermittently-disconnected scenario, you probably want to
look at merge replication. You can do this quite well using the .NET
Compact Framework and either VB.NET or C# in Visual Studio.NET 2003 or
later.

If you just need some way to get the data out into another file, you could
write your code to read the data, a row at a time, and write it to an XML
file, a text file of some sort that you design yourself, or whatever, but
there's no file to be synced.

Paul T.
 
P

Paul Aspinall

Hi
Thanks for the reply

I am familiar with merge replication, and do see that as an option. However,
what is the trigger for the PDA device being connected to the PC... ie.
Where do I put the code to execute the sync via merge replication??
I presume you need to hook into ActiveSync somehow?

Thanks

Paul
 
P

Paul G. Tobey [eMVP]

Well, the first thing that comes to mind is a RAPI application on the PC
which is configured via the registry to launch when the PPC connects and, in
turn, launches an application on the PPC.

You may also be able to use CeRunAppAtEvent on the device itself, maybe with
NOTIFICATION_EVENT_NET_CONNECT or NOTIFICATION_EVENT_SYNC_END, to start the
application for synchronization...

Paul T.
 
R

r_z_aret

Well, the first thing that comes to mind is a RAPI application on the PC
which is configured via the registry to launch when the PPC connects and, in
turn, launches an application on the PPC.

To clarify a bit:

I know of two ways a program running on a desktop can tell when a
handheld has connected to ActiveSync:

1) The desktop app can call CeRapiInit. This RAPI function will not
return until a device connects. Note that CeRapiInit is similar, but
does not wait.

2) Any desktop application will be started automatically if the path
to its executable is provided as a string value for the registry key
(in the desktop registry):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnConnect
The name of the value doesn't matter, so I suggest using the name of
the application. The application started this way doesn't need to use
any RAPI functions.


-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
 
P

Paul Aspinall

Robert - Good info. - Thanks

Paul

To clarify a bit:

I know of two ways a program running on a desktop can tell when a
handheld has connected to ActiveSync:

1) The desktop app can call CeRapiInit. This RAPI function will not
return until a device connects. Note that CeRapiInit is similar, but
does not wait.

2) Any desktop application will be started automatically if the path
to its executable is provided as a string value for the registry key
(in the desktop registry):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnConnect
The name of the value doesn't matter, so I suggest using the name of
the application. The application started this way doesn't need to use
any RAPI functions.


-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and
please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top