Here is an example that is taken from a couple of sources that are listed later:
Put this in a module:
Declare Function DESKTOPTODEVICE Lib "c:\program files\Microsoft ActiveSync\adofiltr.dll" _
(ByVal desktoplocn As String, _
ByVal tablelist As String, _
ByVal sync As Boolean, _
ByVal overwrite As Integer, _
ByVal devicelocn As String) As Long
Declare Function DEVICETODESKTOP Lib "c:\program files\Microsoft ActiveSync\adofiltr.dll" _
(ByVal desktoplocn As String, _
ByVal tablelist As String, _
ByVal sync As Boolean, _
ByVal overwrite As Integer, _
ByVal devicelocn As String) As Long
Call it like this:
Result = DESKTOPTODEVICE(cn, "#Export..#Notes..", False, 1, "" 'calls the code to do the sync(from microsoft.com and vbce.com)
That should give you a start - I haven't used it extensively...actually not at all for a litte while, but I know that's the idea. Check microsoft's site for more information as well.
Hope that helps!
If you get this working right you might consider putting your code on an FAQ and also replying to this thread so that others can benefit from this as well.
I made an application for a company gas that collects data in pockets pcs.
This is my code to transfer/recieve data from/to the pocketpc
the tables you want to transfer/receive must be defined with two periods ".."
'upload from the local DB to the desktop DB
listtables = "Conduce..ConduceDetalle..Inspections..Reporte..Config..Abonos..Items_New..History..Ponche..ClientesNuevos.."
intRetVal = DEVICETODESKTOP(App.Path + "\lgas_" & terminal & ".mdb", _
listtables, False, True, "\my documents\lgas.cdb"
If intRetVal <> 0 Then
MsgBox "Comunicacion con la pc de bolsillo no pudo ser completada", , "LIGHT GAS"
Exit Sub
End If
'download from the desktop to the local DB
intRetVal = DESKTOPTODEVICE(App.Path + "\lgasconfig.mdb", _
"", False, True, "\my documents\lgasconfig.cdb"
If intRetVal <> 0 Then
MsgBox "Error " & intRetVal & " Occurred."
'StatusBar1.SimpleText = "Error " & intretval & " Occurred."
Else
MsgBox "Transfer was Successful"
Unload Me
'StatusBar1.SimpleText = "Transfer was Successful"
End If
Module form
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const MF_BYPOSITION = &H400&
' adofiltr library calls
Declare Function DEVICETODESKTOP Lib "adofiltr.dll" _
(ByVal desktoplocn As String, _
ByVal tablelist As String, _
ByVal sync As Boolean, _
ByVal overwrite As Integer, _
ByVal devicelocn As String) As Long
Declare Function DESKTOPTODEVICE Lib "adofiltr.dll" _
(ByVal desktoplocn As String, _
ByVal tablelist As String, _
ByVal sync As Boolean, _
ByVal overwrite As Integer, _
ByVal devicelocn As String) As Long
'Constants required by CE functions
Public Const INVALID_HANDLE = -1
Public Const GENERIC_READ = &H80000000
Public Const GENERIC_WRITE = &H40000000 '(1073741824)
Public Const FILE_SHARE_READ = 1
Public Const FILE_SHARE_WRITE = 2
Public Const CREATE_ALWAYS = 2
Public Const OPEN_EXISTING = 3
Public Const INIT_SUCCESS = 0
Public Const WRITE_ERROR = 0
Public Const READ_ERROR = 0
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.