Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

This resource has not currently been approved, and is not currently linked to from our directory of resources. It is being displayed here for preview by the author and moderators only.
Rated
Read 2,936 times

Contents

Related Categories

ADOCE Data Access Example - Form Design With eVB

sync_or_swim

Form Design With eVB

This tutorial is intended to follow on from the basic introduction to eVB concepts available at: http://www.developerfusion.co.uk/show/5071/

 

This tutorial describes how to add components to a form, create a Database Connection and retreive data using an SQL query enabling you to create a simple data access program for a PDA.

 

Prerequisites

 

This tutorial assumes that you have installed eVB and the relevent runtime/SDK, details on how to do this available at: http://www.developerfusion.co.uk/show/5071/ 

 

Before you start you must create an Access database on the desktop PC called Products.mdb.  Create a table called Products with three fields Desc, Price and ProdID where ProdID is the primary key of type numeric.

 

Drag and drop this mdb file into the MyMobileDevice folder and you will see the ConfirmFileConvert Dialog, follow the instructions to convert your database into PocketAccess format and synchronise it with the database you have created on your desktop.

 

Getting Started

 

We shall now create a simple application for the PocketPC which will access this data and display it on a form.

 

1.  Open Microsoft eMbedded Visual Basic and choose “New Windows CE For Pocket PC 2002 Project”.

 

2.  Add a Label to the form and change it’s name property to lblName, it’s caption property to Simple Data Access Example, it’s backcolor property to &H00E0E0E0& and it’s alignment property to 2 - vbCenter

 

3.  Add another label to the form and set it’s name = lblEnter, caption = Enter a Product ID, backcolor = &H00E0E0E0& and alignment = 1 - vbRightJustify

 

4.  Add a textbox to the form and set it’s name = txtEnter and clear it’s text property

 

5.  Change the forms caption property to something like “Product Inventory” and it’s backcolor property to &H00E0E0E0&

 

6.  Add a frame component to the form and change it’s caption to “Details” and it’s visible property to false

 

7.  Add another label but instead of placing it anywhere on the form, make sure to drag it onto the frame.  Change it’s backcolor to white, alignment to vbRightJustify and it’s caption property to “Description”.  Repeat this process but change the label’s caption property to “Price”

 

8.  Add a textbox to the frame clearing it’s text property and changing it’s name to txtDesc.  Repeat this process for txtPrice. 

 

9.  Add a Button to the Form changing it’s style property to 1 – vbButtonGraphical, it’s BackColor to &H00FF8080& and it’s caption to “GO”.  The form should look something like:

 

Comments