Converting from access (.mdb) to pocket access (.cdb)

Posted on 2004-11-25
Last Modified: 2013-11-18
How do I convert from desktop access to pocket access?  I need to do this totally in the desktop environment.  I'm using the pocket pc 2003 emulator to test a program written in c# for the pocket pc using visual studio.  Once the access file is converted to pocket access, I will copy it to the emulator.  The solution I need is: how do I convert the .mdb to .cdb without using active sync or buying a third party software package?
Question by:fly412s
    LVL 7

    Expert Comment

    LVL 48

    Expert Comment

    DesktopToDevice API

    DesktopToDevice enables programmatic control over the conversion of .mdb files to ADOCE tables.
    Its behavior parallels that of the Import from Database to Mobile Device 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 HRESULT, is returned by the function.
    The calling application then can take appropriate action.

    Show me the code!

    DESKTOPTODEVICE (DesktopLocn, TableList, Sync, Overwrite, DeviceLocn)

        Specifies the file name and path of the .mdb file to be transferred, or the DSN name if
        ODBC support is enabled.
        Specifies the list of tables and fields that is converted and copied to the device.
        It takes the following form:


        A leading “!” marks this table as read-only on the device.
        If this is a zero-length string ("") or if the parameter is not provided,
        then the default copying of all tables and appropriate fields is performed.
        If a table is requested but no field list is provided, then the default fields are copied.

        The following code example shows how to copy the Employees table as read-only,
        how to copy the Product ID and Product Name fields from the Products table,
        and how to copy the Order ID field from the Orders table.

    !Employees..Products.Product ID.Product Name..
    Orders.Order ID..

        The simplest form of TableList is


        This code example shows how to copy the entire Employees table to the device and
        enable it to be updated.

        Because neither a period (.) nor an exclamation mark (!) are valid in field or table names,
        there is no need to delimit table names. Delimited field or table names are not supported.
        Optional. Always False. Provided for future compatibility.
        Optional. Setting this parameter to True overwrites tables with the same name on the device.
        Setting this parameter to False generates new table names. True is the default.
        Provided for future compatibility. Always a zero-length string ("").
        Database tables are copied to the object store on the H/PC.


    The following code example shows a simple Visual Basic application that copies a subset of the
    Northwind database to the device with no synchronization, but overwriting any existing
    Northwind tables. The Employees table is sent as a read-only table,
    while the Products table can be updated.

    Declare Function DESKTOPTODEVICE 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.ID.Name.Quantity..", False, True, "")
    If result <> 0 Then MsgBox "An error occurred transferring the data"


    Author Comment

    jimwasson:  Great start in the right direction, however, I'm not programming in the eVB environment.  I tried both of the url's you listed.  Neither one was able to solve my problem.

    Mikal613:  I've already found the web site you reference, however, I do not want to programmatically create the pocket access database.

    Thank-you both very much.  Any other suggestions?
    LVL 48

    Expert Comment

    well what do you want if not programmatically ?

    Author Comment

    I plan on ultimately using active sync to synchronize the desktop .mdb file with the hand held .cdb file.  Active sync does a great job of converting the files.  The conversion from desktop to hand held is not the issue.  The issue is converting the access file with resources only on my desktop then copying the .cdb file to the emulator.  Until my project is ready to be distributed, I need to do all of the testing on a pocket pc 2003 emulator.  
    LVL 48

    Expert Comment

    so you want an EXE to convert the database on your desktop? thats it?
    LVL 48

    Expert Comment


    Author Comment

    I'm sorry if I aggravated you.  You're the top expert in this forum.  I recognize your devotion to the programming environment.  

    I looked at devbuzz and could not find an executable to convert the database on my desktop.

    Author Comment

    By the way, you're exactly right.  An exe converter is exactly what I'm looking for.
    LVL 48

    Accepted Solution

    There is none.

    your options is sending a Text file to the emulator and the emulator converts it to a CDB (sits on your machine)

    buy a cheap Pocket Pc  and have Act Sync convert it for you.

    There is no program out there . MS does have the power to make it if we had access to the Active Sync code but we dont.

    Sorry ;(

    Author Comment

    I've discovered a way that works.  I use ActiveSync to convert the desktop Access database to the Pocket Access format.  When the Pocket Access file is on my Ipaq, I simply e-mail it as an attachment to myself from my Ipaq.  It works perfect.  Now, I have a Pocket Access database file on my desktop which I can use to test in my development environment on my desktop.
    LVL 25

    Expert Comment

    Thanks. We end up using PDA Tech Pocket PC CeSync v4 ( It converts MDB <-> CDB on all versions of ActiveSync and even works with Vista!
    LVL 25

    Expert Comment

    ^ Oops, wrong thread. Please delete.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator ( This article presumes a wor…
    Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now