• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3808
  • Last Modified:

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

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?
0
fly412s
Asked:
fly412s
  • 5
  • 5
  • 2
  • +1
1 Solution
 
jimwassonCommented:
0
 
Mikal613Commented:
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!
Syntax

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

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

[!]tablename[<period>fieldname]<period><period>
[[!]tablename[<period>fieldname]<period><period>]

    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

Employees..

    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.
Sync
    Optional. Always False. Provided for future compatibility.
Overwrite
    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.
DeviceLocn
    Provided for future compatibility. Always a zero-length string ("").
    Database tables are copied to the object store on the H/PC.

Example

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"

 
0
 
fly412sAuthor Commented:
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?
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
Mikal613Commented:
well what do you want if not programmatically ?
0
 
fly412sAuthor Commented:
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.  
0
 
Mikal613Commented:
so you want an EXE to convert the database on your desktop? thats it?
0
 
Mikal613Commented:
0
 
fly412sAuthor Commented:
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.
0
 
fly412sAuthor Commented:
By the way, you're exactly right.  An exe converter is exactly what I'm looking for.
0
 
Mikal613Commented:
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 ;(
0
 
fly412sAuthor Commented:
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.
0
 
nauman_ahmedCommented:
Thanks. We end up using PDA Tech Pocket PC CeSync v4 (http://www.pda-tec.com/pocketpccesync.shtml). It converts MDB <-> CDB on all versions of ActiveSync and even works with Vista!
0
 
nauman_ahmedCommented:
^ Oops, wrong thread. Please delete.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now