DeviceToDesktop enables programmatic control over the conversion of ADOCE tables to .mdb files. Its behavior parallels that of the Export from Mobile Device to Database dialog box, except that the user-choice dialog boxes do not appear. All progress bars do appear, showing the transfer status. An error return does not cause the log file to automatically display. Instead, an error value, which is the offending HRESULT, is returned by the function, and the calling application can take the appropriate action. In contrast to the DesktopToDevice function, there is no way to specify which fields are converted. All fields in a table are converted by default.
DEVICETODESKTOP (DesktopLocn, TableList, Sync, Overwrite, DeviceLocn)
tablename<period><period>[tablename<period><period>]
If this string is a zero-length string ("") or the argument is not provided, then the default copying of all tables is performed.
The simplest form of TableList is
Employees..
This code example shows how to copy the entire Employees table to the database file specified in the desktop computer location.
Because periods are not valid in table names, there is no need to delimit table names. Delimited table names are not supported.
The following code example shows a simple Visual Basic application that copies a subset of the Northwind database to the device with no synchronization, while overwriting any existing Northwind tables. Both the Employees and Products tables are sent in their entirety.
Declare Function DEVICETODESKTOP Lib "c:\program files\windows ce services\adofiltr.dll" _ (ByVal desktoplocn As String, _ ByVal tablelist As String, _ ByVal sync As Boolean, _ ByVal overwrite As Integer, _ ByVal devicelocn As String) As Long result = DESKTOPTODEVICE("c:\mydbs\nwind
.mdb", _
"!Employees..Products..", False, True, "")
If result <> 0 Then MsgBox "An error occurred transferring the data"