IBM DB2 Everyplace*

Plug-In for AppForge MobileVB, Version 8.2

README NOTES

(c) Copyright 1999-2004 International Business Machines Corp. All rights reserved.
* Trademark of IBM Corporation, Licensed materials - Property of IBM

README NOTES Contents

  1. Introduction
  2. Contents
  3. New fixes and features
  4. Known problems and limitations
  5. License information
  6. Trademarks

Introduction

This document provides information about the DB2 Everyplace plug-in for AppForge MobileVBTM.  This plug-in enables Microsoft Visual Basic developers to develop DB2 Everyplace applications using AppForge's  MobileVBTM . Visual Basic programmers utilizing MobileVBTM can now easily develop mobile device applications which use the DB2 Everyplace relational database and synchronization technology. Mobile platforms supported are devices based on PalmOS or WinCE/PocketPC based devices.

Contents

1.        Pre-Requisites

2.        Installation Instructions

3.        Usage

4.        Sample

5.        Resources

 

Pre-Requisites:

§         AppForge MobileVB 5:               This plug-in will be referenced in the applications created in Mobile VB.

§         AppForge Booster:                   This application must be installed on handheld devices to run applications written with AppForge software.

§         AppForge Enterprise Booster:           This application enables third parties applications for use with AppForge.

§         DB2 Everyplace Database:       The DB2 Everyplace database is a relational database that resides on your mobile device.

§         DB2 Everyplace Sync Server:   DB2e Sync Server is a bi-directional synchronization service running on a mid-tier server that synchronizes data between the DB2e database on mobile devices and enterprise data sources.  This is an optional pre-requisite and is required if an application uses the sync function.

 

                  Installation Instructions:

After installing all the above tools, run the DB2 Everyplace SDK installation program.  Select the Custom installation, and under DB2 Everyplace Software Development Kit check the option "Plug-in for AppForge MobileVB" and continue the installation.

 

Completed install will copy device executable files for each platform.  Users need to modify the registry file to update the install path.  This file is located under "\DB2EveryplaceSDK\SDK\AppForge\db2e_appforge.reg" and contains the default path value.  Double click on this file in windows explorer.  This will add the registry entry, which is needed to build application executable.

 

These files needs to be installed on the mobile device before you can use MobileVB generated application using this plug-in.  These files can be located under  \DB2EveryplaceSDK\SDK\AppForge\Clients.

 

For Palm:

Install the "AFDB2ePalm.prc" application on the device using the Install function of the Palm Desktop software and  HotSync to install application.

 

For WinCE:

Copy "db2eplugin.cab" to any directory on the device. Tap the file on the device to install the application.

 

 

Usage:

This plug-in implements the set of DB2 Everyplace Call Level Interface (CLI).  These methods provide the application programming interface for relational database access.  The first step before starting to write an application is to reference the library in the project.  In Visual Basic open the Project menu and click "References".  

 

 

Check the "AFDB2eLib" entry in the list.

 

 

 

Once it is referenced, the classes provided in this library can be instantiated.  It has two classes CAFDB2e, CAFDB2eSync.  CAFDB2e implement the DB2 Everyplace CLI functions and CAFDB2eSync implements the DB2 Everyplace Sync v8.x APIs.

 

To create the instance type, enter the following:

 

Public DB2e   As AFDB2eLib.CAFDB2e

Public WithEvents DB2eSync As AFDB2eLib.CAFDB2eSync

 

Set DB2e = New AFDB2eLib.CAFDB2e

Set DB2eSync = New AFDB2eLib.CAFDB2eSync

 

Once you created the instance you can make the call to functions implemented in each class, e.g.

 

    rc = DB2e.SQLAllocHandle(SQL_HANDLE_DBC, henv, hdbc)

 

In the above example first call we use the "SQL_HANDLE_DBC" constant.  There are a few constants which are also defined in the library.  It can be used once an instance is created for any class.

 

To get detailed information about CLI functions and Sync APIs please refer to DB2 Everyplace Application Development Guide. 

 

Sample:

The included sample application has versions for the Palm and WinCE platforms.  This sample demonstrates the usage of the different CLI calls.  It provides an example of the execution of DDL statements, prepare sql statement, bind parameters, and synchronization.  File "db2evb.bas" contains the code and it is same for all  platforms.

 

                                         

 

In the example above, if "Select" button is clicked it creates the table and inserts two records.  If "Insert" is clicked it gets the values from the Col1 and the Col2 fields and inserts the records with these values.  Clicking "Sync" will sync the application.

 

How to debug AppForge project in VB IDE :

 

1.      Please follow all the installation instructions. Make sure paths in "db2e_appforge.reg" file are correct.

 

2.      Copy all the dll files from "C:\DB2EveryplaceSDK\Clients\Win32\database\x86" in C:\DB2EveryplaceSDK\SDK\AppForge\Clients\Win32" directory.

 

3.      Copy all the dll files from "C:\DB2EveryplaceSDK\Clients\Win32\sync\en_US" in "C:\DB2EveryplaceSDK\SDK\AppForge\Clients\Win32" directory.

 

4.      Register the "AFDB2eWin32.dll", use "Register.bat", in "C:\DB2EveryplaceSDK\SDK\AppForge\Clients\Win32" directory.  You should see success message and you are ready to debug in Visual Basic.

 

 

Resources:

To get more information about application development for DB2 Everyplace please visit the web at

http://www.ibm.com/software/data/db2/everyplace/.

 

To get more information about AppForge please visit http://www.appforge.com/ .

 

DB2 Everyplace Library at http://www.ibm.com/software/data/db2/everyplace/library.html .

 

New fixes and features

§         Support added for the new Sync v8.x APIs

Known problems and limitations

§    Callbacks during synchronization are not supported in this release.

§         In "iscEngineSetListener" function in "AFDB2eLib.CAFDB2eSync" class second parameter should be passed as 0.  This invokes the default listener.  Result of the synchronization passed to the "DB2eSyncResult" event on the "AFDB2eLib.CAFDB2eSync" class object.

§         On PalmOS events cannot be invoked as "WithEvents" keyword cause an exception when instance of  "AFDB2eLib.CAFDB2eSync" class is created. 

§         The DB2 Everyplace Sync Client needs to be configured before the "AFDB2eLib.CAFDB2eSync" class is invoked.

§         In the DB2 Everyplace CLI documentation some functions take SQLPointer datatype parameters.  This is replaced with String type parameters in this implementation.

§         If the user application uses an earlier version of the DB2 Everyplace AppForge plugin, it needs to be recompiled with the newer plugin.

License information

Please read the license information before using this product.  You can find the license information in the directory where you installed the product.

Trademarks

IBM, DB2, and DB2 Everyplace are trademarks of IBM Corporation.  Other company, product, and service names may be trademarks or service marks of others.

Last updated 08/30/04