Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transferring Data between PocketPC & Desktop PC

Status
Not open for further replies.

DonLee

Programmer
Sep 25, 2002
1
0
0
MY
Does anyone of u have any experience writing a program to transfer data from PocketPC to a Desktop PC and on the opposite way?

Can someone show me how? I need some clues or maybe a simple examples or source codes.....

Please advice....


regards,
Don
 
Hi Don,
Did you find anything?

AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
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 &quot;Comunicacion con la pc de bolsillo no pudo ser completada&quot;, , &quot;LIGHT GAS&quot;
Exit Sub

End If

'download from the desktop to the local DB
intRetVal = DESKTOPTODEVICE(App.Path + &quot;\lgasconfig.mdb&quot;, _
&quot;&quot;, False, True, &quot;\my documents\lgasconfig.cdb&quot;)


If intRetVal <> 0 Then
MsgBox &quot;Error &quot; & intRetVal & &quot; Occurred.&quot;
'StatusBar1.SimpleText = &quot;Error &quot; & intretval & &quot; Occurred.&quot;
Else
MsgBox &quot;Transfer was Successful&quot;
Unload Me
'StatusBar1.SimpleText = &quot;Transfer was Successful&quot;
End If


Module form

Public Declare Function GetSystemMenu Lib &quot;user32&quot; (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib &quot;user32&quot; (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 &quot;adofiltr.dll&quot; _
(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 &quot;adofiltr.dll&quot; _
(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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top