Sie sind auf Seite 1von 269

1

Volume

POCKETSOFT.CA
abcDB™ v6.15 ‘Database’ Manual

‘abcDB’ Database
v6.15
WWW.POCKETSOFT. CA

Learning ‘abcDB™’ Database

 2001-2004 by PocketSOFT.ca
Email: support@PocketSOFT.ca
Website: http://www.PocketSOFT.ca
Table of Contents

WHAT’S NEW? 8

CHAPTER 1 -- INTRODUCTION TO ABCDB™ DATABASE 10

1.1 WELCOME TO ABCDB! 10


1.2 BEGINNERS GUIDE TO DATABASES 10
1.3 HANDY TIPS WHILE USING ABCDB 11

CHAPTER 2 -- INSTALLING ABCDB™ 17

2.1 HARDWARE REQUIREMENTS … 17


2.2 INSTALLING ABCDB™ … 17

CHAPTER 3 -- STARTING ABCDB™ 19

3. 1 STARTING ABCDB™ 19
3.2 IMPORTING DATA USING ACTIVESYNC 20
3.3 CREATING TABLES 23
3.4 OPENING AND USING TABLES AND FILTERS 25
3.5 EDITING TABLES 29
3.6 CREATING QUERIES 30
3.7 EDITING QUERIES 34

CHAPTER 4 – FORMS 36

4.1 USING FORMS … 36


4.2 CREATING/EDITING FORMS … 38
4.3 BACKING UP AND DISTRIBUTING YOUR FINISHED FORMS TO OTHER POCKETPC’S 52

CHAPTER 5 -- INTRODUCTION TO PROGRAMMING AND CREATING FORMS 62


A B C D B D A T A B A S E – I T ’ S A S E A S Y A S ‘ A - B - C ’ !

5.1 THE BASICS 62


5.12 USING TAGS IN ABCDB. 64
5.13 USING VARIABLES IN ABCDB. 65
5.14 USING MODULES IN ABCDB. 65
5.15 PROPER SYNTAX WHEN ENTERING SQL STATEMENTS 66
5.2 CREATING OUR ‘HELLO-WORLD’ APPLICATION 67
5.3 CREATING THE ABCDB™ REALTOR APPLICATION 73
5.4 CREATING OUR ‘ABCDB CALCULATOR’ APPLICATION 90
5.5 CREATING OUR ‘STATES’ APPLICATION 92
5.6 USING ‘SUBFORMS’ IN ABCDB. 97

CHAPTER 6 – USING ABCDB ‘WIRELESS’ DATABASE 106

6.1 ADDING A NEW REMOTE CONNECTION 106


6.2 ADDING A REMOTE LINKED TABLE 109
6.3 ADDING A REMOTE QUERY 113

CHAPTER 7 – PRINTING WITH ABCDB (PRINTING ENABLED VERSIONS ONLY) 117

7.1 PRINTER TUTORIAL 117


7.2 PRINTER SETTINGS 123
7.3 NETWORK PRINTING (POCKETPC 2002 ONLY) 125

APPENDIX A -- ABCDB™ FIELD TYPES 129

APPENDIX B -- SQL REFERENCE 131

B.1 SELECT – JOIN 131


B.2 SELECT – LIKE 132
B.3 SELECT – ORDER BY 133
B.4 SELECT – PROJECTION 133
B.5 SELECT – RESTRICTED 134
B.6 SELECT – SIMPLE 135
B.7 ALTER TABLE 135
B.8 CREATE INDEX 136
B.9 DROP DATABASE 137
B.10 DROP TABLE 137
B.11 DROP INDEX 138

APPENDIX C -- ABCDB™ ‘SCRIPT’ COMMANDS 139

ADDEVENT 139
CAPTION 140
COLOR 140
CREATECONTROL 140
A B C D B D A T A B A S E – I T ’ S A S E A S Y A S ‘ A - B - C ’ !

CURSOR 141
DELETECONTROL 141
DRAWELLIPSE 141
DRAWLINE 142
DRAWRECTANGLE 142
DRAWTEXT 142
DROPREFRESH 143
ENABLE 143
EXECUTE 144
EXIT 144
EXITAPP 144
EXPORT 145
FONT 145
FORMOPEN 146
FORMREQUERY 146
GOTO 147
GPSCLOSE 147
GPSINIT 148
GPSOPEN 148
GRIDREFRESH 148
IMAGE 149
IMPORT 149
LISTVIEW 150
MENUADD 150
MENUBASEADD 150
MENUCLEAR 151
MENUDELETE 151
MOVE 151
MOVEFIRST 152
MOVELAST 152
MOVENEXT 152
MOVEPREV 153
MOVETO 153
OUTLOOKADD 153
OUTLOOKDELETE 153
OUTLOOKDISPLAY 154
OUTLOOKSORT 154
OUTLOOKWRITE 154
PLAYSOUND 154
POWERPICK 155
PRINT 156
PROPSET 156
QUIT 156
RECORDDELETE 156
RECORDNEW 157
RECORDSAVE 157
REGISTRYDEL 157
REGSETINT 158
REGSETSTR 158
RETURN 158
RUNAPP 158
A B C D B D A T A B A S E – I T ’ S A S E A S Y A S ‘ A - B - C ’ !

RUNSUB 159
RUNSQL 159
RUNUPDATE 159
SCRIBCLEAR 160
SCRIBFSAVE 160
SCRIBSAVE 160
SCRIBLOAD 160
SETFIELD 161
SETFOCUS 161
SETMEM 161
SETTAB 162
SETVALUE 162
SIP 162
SUBFORMREFRESH 163
TABLEDELETE 163
TEST 163
TIMER 164
TREEADDNODE 164
TREEDELNODE 164
TREESET 165
VISIBLE 165
WHILE/ENDWHILE 165
WINDOWPOS 166
ZOOM 166
ZORDER 166

ABCDB™ FORM CONTROLS (PROPERTIES AND EVENTS) 168

FORM 168
TEXTBOX CONTROL 170
DROPDOWN CONTROL 172
LABEL CONTROL 174
COMMAND CONTROL 175
CHECKBOX CONTROL 176
GRID CONTROL 177
DATE FIELD CONTROL 179
SCRIBBLE CONTROL 180
IMAGE CONTROL 181
TAB CONTROL 182

APPENDIX E -- ABCDB™ FUNCTIONS 184

ABS 184
ASC 184
AUTOID 184
BRUSH 185
CHR 185
RGBCOLOR 185
CURRENTTAB 185
A B C D B D A T A B A S E – I T ’ S A S E A S Y A S ‘ A - B - C ’ !

DADD 186
DATE 186
DATETIME 186
DAY 187
DDIFF 187
DROPID 188
EVAL 188
EXP 188
FILEPICK 188
NEWFONT 189
FORMAT 189
GPSALT 189
GPSALTUNIT 190
GPSDATE 190
GPSLAT 190
GPSLONG 191
GPSMAXALT 191
GPSMAXSPEED 191
GPSOK 192
GPSRAW 192
GPSSPEED 193
GPSTIME 193
GRIDCOL 193
HOUR 194
INPUT 194
INSTR 194
INT 195
KEYCHAR 195
LEN 195
LISTID 195
LOOKUP 196
MESSAGEBOX 196
MID 197
MINUTE 198
MONTH 198
MONTHNAME 198
NEXTID 198
OUTLOOKCOUNT 199
OUTLOOKFIND 199
OUTLOOKFINDNEXT 199
REGGETINT 200
REGGETSTR 200
RANDOM 200
RECCOUNT 200
RECNO 201
REPLACE 201
RIGHT 201
RNDID 202
ROUND 202
SECOND 202
SIN 202
A B C D B D A T A B A S E – I T ’ S A S E A S Y A S ‘ A - B - C ’ !

SQR 203
TAN 203
TAVG 203
TCOUNT 204
TID 204
TIME 204
TMAX 205
TMIN 205
TSUM 205
WEEKDAY 206
WEEKDAYNAME 206
YEAR 207
WEBSERVICE 207

APPENDIX F – ALL ABOUT PRIMARY KEY INDEXES AND ENSURING YOUR MS ACCESS
TABLES WILL ‘SYNCHRONIZE’ 208

F.1 CREATING PRIMARY KEY INDEXES IN MICROSOFT ACCESS 209

APPENDIX G – INSTALLING THE ABCDB™ ‘WIRELESS’ SERVER 223

CAN I IMMEDIATELY USE THE APPLICATION SERVER? 223


CAN I IMMEDIATELY USE THE APPLICATION SERVER? 224
HOW DO I CONNECT THE APPLICATION SERVER TO THE INTERNET? 225
HOW DO I RUN THE APPLICATION SERVER SOFTWARE? 226
II. Provide a connector to the database. 227
III. Run the dbBridge abcDB™ ADO Application Server. 227
WHAT ARE SOME SPECIAL CONSIDERATIONS (FIREWALL, ENCRYPTION, ETC.)? 231
Firewalls: 231
APPLICATION SERVER SETTINGS DETAILS. 231
SETTING UP THE SERVER: 234

APPENDIX H – IMPORTING DATA FROM OTHER ODBC DATA SOURCES 241

APPENDIX I – FREQUENTLY ASKED QUESTIONS 246

APPENDIX J – SUPPORTED PRINTERS (ABCDB PRINT ENABLED VERSIONS ONLY) 248

APPENDIX K – USING ABCDB WITH GPS RECEIVERS 251

APPENDIX L – OUTLOOK FIELDS 255


A B C D B D A T A B A S E – I T ’ S A S E A S Y A S ‘ A - B - C ’ !

APPENDIX M – IMPLEMENTING WEBSERVICES 257

END FUNCTION END CLASS 260

INDEX 261
I T ’ S A S E A S Y A S A - B - C !

F
FORWARD

What’s New?
This manual has been developed using abcDB v6.15 If you are using a
version prior to this, please realize that some functions and features may
differ slightly or may not exist at all.

Version 6.15 includes the following new features:

• COMPLETELY rewritten to improve performance and ease the transition to new


devices in future releases.

• Ability to open multiple forms, queries and tables simultaneously.

• Unlimited controls per form.

• Support for remote WEBSERVICES!!! (See Appendix M)

• Form designer now includes user-definable ‘grid lines’ to make designing forms easier.

• Multiple new commands allowing your application to read and write to the pocketpc
registry.

• Background and foreground color can now be set for button controls

• Powerful integration with ‘Microsoft Pocket Outlook’. You can now


access/delete/modify your Outlook data right from within your abcDB application!

• Dozens of new commands and functions

• Treeview control

• Listbox control

• New ‘event’s – KeyPress, OnPaint

• Image controls now support JPG,GIF, and BMP image types

8
I T ’ S A S E A S Y A S A - B - C !

• Scribble control now allows you to save your data to a ‘memo’ field in your database
table

• User definable color schemes allows you to run abcDB in whatever colors you like the
most!

• For the more advanced abcDB users, there is a new DEBUG menu option which
allows you to ‘debug’ your forms code by running the code line-by-line. This feature
makes is MUCH easier to find and ‘squash’ those pesky programming bugs.

• When designing forms, you can now select multiple controls and align them and size
them. This makes designing forms MUCH easier and more efficient.

• Dropdown controls can now have an associated ‘itemdata’ column. In other words,
you can display text values (ie. CustomerNames) and then return the associated ID (ie.
CustomerID) by using the new DROPID function

• New DropDown Wizard. When entering data directly using the ‘tables’ view of
abcDB, you can now specific certain fields in your tables to be displayed as
‘dropdown lists’. Access this new feature in the “FILE/Options/Setup Dropdown Lists”
menu

• Now can reference control values that exist on other forms. (ie.
SETVALUE(~MyTextbox~//~Form2!Textbox1~)

• MUCH MORE!

9
I T ’ S A S E A S Y A S A - B - C !

1
Chapter

Chapter 1 -- Introduction to
abcDB™ Database

1.1 Welcome to abcDB!

W
elcome to ‘abcDB™’ Database for the PocketPC. abcDB allows you to create
powerful ‘mobile’ database applications that really do enable you to ‘take your
data with you’.

Does it take a ‘rocket-scientist’ to create applications with abcDB? No. In fact, you can
import your data from your desktop computer, create queries, data entry forms, and much
more without learning a SINGLE LINE OF CODE.

For those who want to take FULL advantage of all the capabilities of abcDB however, you’ll
want to sit down and delve into some of the deeper aspects of abcDB ‘programming’. You
can read all about this in Chapter 5.

But before going too far, it might be good to brush up on some basic terminology and
database knowledge.

So let’s do that now…

1.2 Beginners guide to databases


What is a DATABASE?

A database consists of information organized to help accomplish a specific goal. For


example, a database might contain data useful in organizing your company’s inventory or
perhaps your personal DVD collection.

The beauty of a database is the fact that, if designed correctly, all data is only entered once.
For example, in an INVOICING database, the customers address and phone information is
stored in a separate ‘customer’ table. All other portions of the database program retrieve the
customers phone# from that table. If a customers phone number were to change, you only
have to change it in ONE place. Otherwise, you may have to dig through all sorts of data

10
I T ’ S A S E A S Y A S A - B - C !

updating it everywhere else. Whenever you use that customer elsewhere in the database,
their new phone# is automatically used.

What are TABLES?

A table consists of data. It can include data related to any topic (ie. Customers, Invoices)
Using a separate table for each topic means that you store that data only once. This results in
a more efficient database and fewer data-entry errors.

What are QUERIES?

Queries are a way of viewing and changing data stored in tables. You can use a query as a
source of data for FORMS. For example, let’s assume that you only want to view all the
customers in your customer table whose last name is ‘Smith’. The easiest way to do this is to
use a query such as:

SELECT * FROM Customers WHERE Lastname = ‘Smith’

What are FORMS?

FORMS are used to enter or display data that is contained in your database table(s).
Forms can be ‘bound’ to a TABLE which means that the data displayed/edited on the
form will be retrieved from the ‘bound table’. For example, you could create a form with
which you can add new customers. In that case, you would ‘bind’ it to your ‘customers’
table.
Forms consists of a variety of controls, such as textboxes, labels, checkboxes, and more.
More information on forms can be found in Chapters 4 and 5.

1.3 Handy tips while using abcDB


It’s often useful to be able to copy/paste or cut/paste data, and although abcDB does include
copy/paste commands in many of it’s menus.

11
I T ’ S A S E A S Y A S A - B - C !

TABLES TAB
abcDB™ is designed to be extremely ‘user-friendly’.
It is very intuitive and easy to use.
Notice that there are 3 main tabs along the bottom of the
screen. In this screenshot, we’re positioned on the TABLES
tab. This tab displays all the tables that are contained in your
database. In this particular database, we can see 6 tables
(Charges, Diag, Loc, Patients, Proc, Visits).

Now look at the 4 buttons along the right side of the screen:

* OPEN – Opens the selected table and allows you to


view/edit the contents.
* NEW – Allows you to CREATE a NEW table.
* EDIT – Allows you to EDIT an existing table.
* DELETE – Allows you to DELETE an existing table.

QUERIES TAB
Here is where you can see a list of all the ‘queries’
contained in the database. In this case there are two
queries (ActivePatients and InactivePatients)
Again, we have exactly the same 4 buttons along the
right side of the screen:
* OPEN – Opens the selected query and allows you to
view/edit the contents.
* NEW – Allows you to CREATE a NEW query.
* EDIT – Allows you to EDIT an existing query.
* DELETE – Allows you to DELETE an existing query.

12
I T ’ S A S E A S Y A S A - B - C !

FORMS TAB
Here is where you can see a list of all the ‘forms’
contained in the database. In this case there are three
forms (Charges, frmPatients and MainMenu)
Again, we have exactly the same 4 buttons along the
right side of the screen:
* OPEN – Opens the selected data-entry form.
* NEW – Allows you to CREATE a NEW form.
* EDIT – Allows you to EDIT an existing form.
* DELETE – Allows you to DELETE an existing form.
* DEBUG – Allows you to run your form and view code as it
executes line by line.

RESULTS TAB
When you OPEN a table or query, you will be
presented with the resulting contents here on the
RESULTS tab.
Let’s look at this screen carefully.

• First of all, in the top left corner, you’ll see a


button called ZOOM. When we tap the ‘zoom’
button, we’re presented with the contents of
the currently selected field in a larger format,
making it easier for you to view and edit it’s
contents.
Let’s tap the DETAIL button now …

MOVE TO NEXT STEP Æ

13
I T ’ S A S E A S Y A S A - B - C !

• This DETAILED view shows all fields in your selected


record in a vertical format, making it easier to edit
your data.

Let’s click the GRID button to return to the previous


screen.

MOVE TO NEXT STEP Æ

Notice that at the top of the screen, you are shown the
current record you’re positioned on, and the total number of
records. This top area of the screen is referred to as the
NAVIGATION MENU.

We’re currently positioned on record #1 of 8.

If you wish, you can type in the record you wish to move to
(ie. 6) and click the GO button. You’ll be repositioned to
display the correct record.

14
I T ’ S A S E A S Y A S A - B - C !

RESULTS TAB TOOLS MENU


The TOOLS menu on your RESULTS tab gives you
many options that allow you to filter and sort your
data. Let’s go through these options one at a time.

Filter
Description
Type

Filter by Filters the table based on the contents of the


selection selected field.

Filter
Filters the table excluding the contents of the
excluding
currently selected field.
selection

Allows you to manually enter your criteria. Ie:


Filter
= ‘JOE’
expression
<> ‘JOE’

LIKE ‘J%’

Field
Will allow you to do a ‘wildcard’ search.
Contains …

Sort Type Description

Sort Sort the results based on the selected field in


Ascending Ascending order

Sort Sort the results based on the selected field in


Descending Descending order

15
I T ’ S A S E A S Y A S A - B - C !

RESULTS TAB NAVIGATION MENU


At the bottom of the screen, you’ll see the menu portion of
the abcDB™ ‘Navigation’ menu (The TOP of the screen is
also referred to as the navigation menu). There are 6
buttons:

- Move to FIRST record


- Move to PREVIOUS record
- Move to NEXT record
- Move to LAST record
- DELETE currently selected record
- Add a NEW record

Any changes you’ve made to a record will be


saved immediately upon tapping any one of the
navigation movement controls.

ADDING A NEW RECORD


After tapping the icon on the navigation menu, you’ll be
presented with a blank line. When you’re done entering
data, simply tap in another record or tap any of the
navigation movement controls.

16
I T ’ S A S E A S Y A S A - B - C !

2
Chapter

Chapter 2 -- Installing abcDB™

2.1 Hardware requirements …

A
bcDB Database will run on any PocketPC running either the Microsoft PocketPC 2000,
PocketPC 2002 OR the newest PocketPC 2003 Operating System.

2.2 Installing abcDB™ …


Installing abcDB™ is a very simple task.

1. Download the abcDB™ installation file.

2. To ensure that no files are currently in use on your PocketPC, close all programs on
your device and then SOFT-Reset your device.

3. Cradle your device, and make sure that ActiveSync is running.

4. Run the abcDB™ installation program, and follow the prompts. If your device is
connected via ActiveSync, you should receive the following prompt:

You may install abcDB™ to a Compact Flash memory card if you wish by clicking NO.
Otherwise, click YES to install abcDB™ to your PocketPC’s main memory.

17
I T ’ S A S E A S Y A S A - B - C !

5. You now will see the following prompt on your desktop computer:

It is VERY important that you answer YES to overwriting all files.

6. Congratulations! You have now successfully installed abcDB™ Database. To run


abcDB™ on your PocketPC, just click START, PROGRAMS, and ABCDB™.

18
I T ’ S A S E A S Y A S A - B - C !

3
Chapter

Chapter 3 -- Starting abcDB™

3. 1 Starting abcDB™
To start abcDB™, tap the START button on your
PocketPC. Then tap PROGRAMS. You will then be
presented with a screen similar to this.

Tap the abcDB™ icon.

19
I T ’ S A S E A S Y A S A - B - C !

You are now presented with the opening screen. Here


you can choose to do one of the following:

1. Open one of your most recently used database


files by tapping it and then tapping the OK button.

2. Select a different file by tapping MORE FILES…

3. Tap NEW to create a new database

4. Click CANCEL to simply go to abcDB™’s main


menu.

3.2 Importing data using ActiveSync


First of all, make sure your PocketPC is
cradled, and ActiveSync is connected.

In this picture, you can see that


ActiveSync is connected, and ready to
accept commands. Click the TOOLS menu
and proceed to the next step.

20
I T ’ S A S E A S Y A S A - B - C !

Notice that in under the TOOLS menu,


there is an option to IMPORT DATABASE
TABLES. Select it now, and proceed.

You are now able to 'browse' through the


folders on your desktop computer to
locate the MS Access database you wish to
import.

In this case, we're going to import the


sample "Car Dealer" database.

Once you've found the correct database,


select it and click OPEN.

NOTE: If you wish to import data from


data sources OTHER than Microsoft
Access, you can change the default file
type to ODBC DATABASE. This will
allow you to import data from other data
sources such as SQL Server, ORACLE,
etc… See Appendix H for more details.

21
I T ’ S A S E A S Y A S A - B - C !

In this step, you're given the opportunity


to choose which tables in the database
you want transferred to your device. In
this case we want ALL the tables
transferred, so make sure all the tables
have checkmarks beside them.

NOTE: If you need to import OLE fields


to your device, you will need to
MANUALLY select these fields in the
screen shown here. ActiveSync will by
default ignore OLE fields!

If you wish to keep your desktop and


PocketPC data 'synchronized', click the
KEEP TABLES SYNCHRONIZED option.

Now ActiveSync will IMPORT the tables


you've selected, and store them on your
PocketPC. You can now use abcDB™
Database to open/view/edit this data as
you can see in the next picture …

22
I T ’ S A S E A S Y A S A - B - C !

Now when you run abcDB™, you'll see


your newly imported database in the list.
Here you can see our CARDEALER
database ready to be opened

Congratulation! Now you know how to


import your important data to your
PocketPC!

3.3 Creating Tables


Here we're presented with an 'empty' database.
Let's continue by creating a simple TABLE.

1. Make sure you've selected the TABLES tab at


the bottom of the screen.
2. Click the NEW button.

23
I T ’ S A S E A S Y A S A - B - C !

Ok, now let’s add a new field to our table.


1. Tap the NEW button to start adding a
new field.
2. In the field name textbox, enter the name
ID
3. In the field ‘Type’ dropdown box, choose
ID INCREMENT
4. Add the new field by tapping the +
button.

: It is always good practice to


NEVER include spaces or special
characters in field and/or table names.

Ok … Now let’s repeat Steps 1-4 for the


following fields:
FieldName: FirstName
FieldType: TEXT
Size: 50

FieldName: Lastname
FieldType: TEXT
Size: 50

FieldName: Address
FieldType: TEXT
Size: 50

FieldName: City
FieldType: TEXT
Size: 50

To save your table, click the FILE/SAVE


menu at the bottom left corner of the
screen, and enter a name for the table. I
am going to call it ‘MyTable’. (Remember
… do not using spaces or punctuation in
your table name!)

24
I T ’ S A S E A S Y A S A - B - C !

Excellent! You’ve just created your first table!

3.4 Opening and using Tables and Filters


Here we are at the TABLES tab of our States
sample database. Instead of viewing the data in
a FORM, let's view it directly at the table level.

1. Tap the TBLSTATES table.


2. Tap the OPEN button in the top right corner
of the screen.

25
I T ’ S A S E A S Y A S A - B - C !

Ok … Now suppose you only want to view the


states that are in the CENTRAL Time Zone.

The hard way to do this would be to scroll


through the list, looking for each one
individually. Let's try something different. Let's
FILTER this table so we're only shown those
records where the TIME ZONE is Central.

1. Tap in any TIME ZONE field where 'Central'


is the value.

Now let's open our TOOLS menu at the bottom


of the screen.

Select the FILTER BY SELECTION and see what


happens …

26
I T ’ S A S E A S Y A S A - B - C !

Wow! Now we are presented with the 15 states


that are in the CENTRAL TIME ZONE.

If we wanted to, we could continue filtering


records here too. I'll leave that up to you. But
for now, let's try something else.

Notice that the column containing the CAPITALS


isn't sorted. Let's SORT these records by that
column. Here's how:

1. TAP in anywhere in the CAPITAL column.


2. Open the TOOLS menu.
3. Select SORT ASCENDING.

Cool! Now our table is sorted by Capital.

Now let's remove all our filtering and sorting by


clicking the TOOLS/REMOVE FILTER menu
item. Do this now before proceeding.

Assume now that you want to find the State


where the Capital City is AUSTIN. What's the
easiest way to do this?

1. TAP anywhere in the CAPITAL column.


2. Open your TOOLS menu again, and select
the FILTER FOR option...
3. You have several options here.
- Using the EQUALS operator, you can find
Exact matches (ie. = 'AUSTIN')
- You can use <> to exclude certain values
- You can use the LIKE operator to find partial
matches or WILDCARD matches (ie. LIKE 'A%'
would find all Capitals that start with the letter
A)
4. For now, let's find an exact match for
AUSTIN. Enter = 'AUSTIN' and click OK

27
I T ’ S A S E A S Y A S A - B - C !

And here we are with our match!

Click the TOOLS/REMOVE FILTER menu item


again to return to all the records.

Now let's try using the FIELD CONTAINS filter.


This filter will search the field that you're cursor
is currently situated in and will perform a
WILDCARD search.

For example, let's choose the TOOLS/FIELD


CONTAINS filter, and enter the word ROCK.
Click OK.

See how it found the Capital of Little ROCK


arkansas! Although this filter can take a long
time on large tables, sometimes it can be very
handy!

28
I T ’ S A S E A S Y A S A - B - C !

Now that you've had a chance to see how


Filtering and Sorting works, it's good to realize
that these same tools are also available while
you're viewing data in FORMS.

Hopefully this quick tutorial has helped you


understand some of the basic techniques used
to navigate through your data.

3.5 Editing Tables


You can edit the structure of existing tables.
1. Select the table you wish to EDIT
2. Tap the EDIT button.
(Note: In this example, I am using the PROC table in
the Patient database.)

You will then be presented with this screen.

29
I T ’ S A S E A S Y A S A - B - C !

Let’s change the ID field to an ID GUID field so that


any new records added will automatically contain a
valid GUID.

1. Tap the ID field.


2. Tap the EDIT button.
3. Now change the field type to ID GUID.
4. Click the + button to save your changes.

Your change is now saved. Click the FILE/SAVE


menu at the bottom of the screen to return to the main
menu.

Of course you could also choose to DELETE an


existing field by choosing it and tapping the DELETE
button.

Although you can modify the FieldName


of an existing field, you cannot change the field
type and/or size unless you’re changing it to ID
Increment, ID Random or ID GUID.

3.6 Creating Queries


Move to the QUERIES tab.
Let’s tap the NEW button, and we’ll create a new
query.

30
I T ’ S A S E A S Y A S A - B - C !

Here we’re presented with the abcDB™ ‘Query-


Builder’.
The first step is to choose the table we wish to query.
Let’s choose the PATIENTS table.

Now let’s choose the fields we wish to display in our


query results. For example, let’s assume that we want
to view the names of all the patients in our database
who are marked as being active.

Move to next step…

Here we have chosen to display the


FIRSTNAME and LASTNAME fields.
Notice that we have chosen NOT to display the
contents of the ACTIVE field.

The 4th row in the Query Builder is for entering


‘criteria’. In this instance we only want to display
records where the ACTIVE field is set to TRUE. In
order to accomplish this, all we have to do is enter the
following in the ‘criteria’ row under our ACTIVE field:

= True

!
If we tap the run button ( ), we’ll see the results.

Move to next step Æ

31
I T ’ S A S E A S Y A S A - B - C !

Now let’s suppose that we only want to see


patients who are active and whose FirstName is
TERY.
All we need to do is modify our query and add the
following ‘criteria’ under the FIRSTNAME column:

= ‘Tery’

Move to next step Æ

This isn’t a very useful query though. We


would need to write a new query for each
different name. Wouldn’t it be nice if we could
get abcDB™ to ASK US for the name we wish
to search for? Well, we can! Here’s how:
Change the criteria in the FIRSTNAME column to this:

= ‘<<Name>>’

This is called a ‘parameter’ query. Whenever abcDB™


sees <<>>, it will stop and prompt the user to enter a
value. That value is then ‘inserted’ into the query.

This gives us a lot of power.

Move to next step Æ

32
I T ’ S A S E A S Y A S A - B - C !

If you are a ‘power-user’ who would rather


enter SQL commands manually, just click the
SQL toolbar button at the bottom of the Query-
Builder. You will then be presented with this
screen, where you can manually enter your
SQL.
When you’re happy with your query, you can save it
by choosing the FILE/Save menu option at the bottom
of the screen. (I’ve named this query MyPatients as
you will see in the next step.)

Here we are at our main menu. And here we


can see our newly created MyPatients query.
Let’s run it and see what happens …

1. Select MyPatients
2. Tap OPEN

Move to next step Æ

33
I T ’ S A S E A S Y A S A - B - C !

Here we are prompted to enter the NAME we


want to search for. Let’s enter Tery and tap OK.

And PRESTO! There’s the one record we were


looking for.
But wait a minute! We just realized that we also
wanted to see the ROOM number that the patient is in!

Move to the next section to see how to edit this query.

3.7 Editing Queries

34
I T ’ S A S E A S Y A S A - B - C !

Move to the QUERIES tab.


We’ve just realized that our MyPatients query does not
show us the ROOM# of our patients.

No problem! We’ll just edit the query, and add the


field.

Let’s select the MyPatients query that we just created in


the previous section.

Tap EDIT.

Notice that when ‘editing’ an existing query, you


cannot use the Query-Builder. You will need to
edit your SQL statement manually.
In this case, we’re going to simply add the ROOM
field to our results. We do this by changing our SQL
to the following:

SELECT [Patients].[Firstname], [Patients].[LastName]


,[Patients].[Room] FROM Patients WHERE
(([Patients].[Firstname] = ‘<<Name>>’) AND
([Patients].[Active] = True))

Click File/Save, and voila! Your MyPatients Query will


now display the names AND room numbers.

35
I T ’ S A S E A S Y A S A - B - C !

4
Chapter

Chapter 4 – FORMS

4.1 Using Forms …


Move to the FORMS tab.

Here we see all the FORMS contained in our sample


States’n’Counties database. We have 3 to choose from
… let’s select frmMain and tap OPEN.

36
I T ’ S A S E A S Y A S A - B - C !

So here we are, viewing our form. Notice that at the


top of the screen, we’re on record #1 of 58, and as we
can see, record#1 contains the State of ALASKA.

We can move throughout our data by tapping the First,


Last, Previous and Next buttons at the bottom.

We can also view all the counties for the chosen state.
Let’s tap COUNTIES and see what happens.

Move to the next step Æ

So there we are! All the different counties found in


Alaska! Cool! (well, not only cool, but COLD! … they
are in Alaska you know <grin>)

Now try moving to the next record. Watch what


happens.

Move to next step Æ

37
I T ’ S A S E A S Y A S A - B - C !

See the power of abcDB™? Due to it’s relational


abilities, every time you move to a new record, the list
of counties automatically updates to reflect the correct
data! Here we see all the counties for the state of
Alabama!

How’d we do that? Later on in our manual, we’ll delve


into some of these more advanced topics. For now
though, it’s nice to know it’s possible!

So it’s easy to see why FORMS are such a POWERFUL


tool! You can create forms to do just about anything!
You can create complete applications that consist of
many different forms. The possibilities are virtually
endless!

In Chapter 5, we’re going to review how this


States’n’counties application was designed step-by-step.

But for now, let’s move on to the next section and we’ll
see how to create your own forms.

4.2 Creating/Editing Forms …


Move to the FORMS tab.

Let’s assume that we now want to create a form that


will allow us to add new counties. How can we do it?
Simple.

Let’s start by tapping the NEW button. (If we wanted to


we could just as easily EDIT an existing form by
selecting it and tapping EDIT)

Move to the next step Æ

38
I T ’ S A S E A S Y A S A - B - C !

Here we need to choose the table (or query) that we


wish our new form to receive its data from.

In this case, we’re going to build a data-entry form for


Counties, so let’s choose our counties table …
tblCounty.

Tap the MANUAL button to continue …

The AUTOFORM button will build a basic


data-entry form automatically.

We are now prompted for the name of this new form.


Let’s call it frmCounties. Click OK to continue to the
next step …

39
I T ’ S A S E A S Y A S A - B - C !

First of all, notice that there are two dropdown


boxes on this screen.
The one on the far right side is our FIELD
PICKER. It contains a list of all the fields found
in our form’s main data source.
Since we chose the table "tblCounties" as the
main data source for our form, the Field Picker
contains all the fields in 'tblCounties'. Let's
choose the COUNTY field.

Now, let's look at all the ‘tools’ that are located


across the top of the screen. From left to right
they are:
1. Button
2. DatePicker
3. Checkbox
4. Dropdown
5. Datagrid
6. Tab control
7. Image control
8. Label
9. Textbox
10. Scribble control
11. Treeview

This is where we choose the type of object we


want to place on our form.

Let's choose a TEXTBOX by ‘tapping’ the textbox


icon.
Move to next step Æ

40
I T ’ S A S E A S Y A S A - B - C !

Now that we've chosen a TEXTBOX, let's place it


on our form.
Simply ‘tap anywhere on your form, and a
standard sized textbox will be placed at that
position.
(NOTE: If you wish, you can TAP And DRAG on your
form to create a control of whatever size you wish)

You're now given the option of placing a


descriptive LABEL for this Textbox.

Click YES.

abcDB™ will then place the label directly above


your textbox.
Move to next step Æ

41
I T ’ S A S E A S Y A S A - B - C !

Now that you’ve added a textbox/label for our


COUNTY field, do the same thing with the
STATE field. Remember to choose the STATE
field from the Field Picker first!
When you’re done, tap the File/Exit button. You will
be asked whether you want to save this form. Answer
YES.

Here we are at our main menu again. See our


new form? Let’s see how it works by selecting it
and tapping OPEN.
Move to next step Æ

42
I T ’ S A S E A S Y A S A - B - C !

Voila! Here we are viewing our very first form!


We can see from our navigation menu that there are a
total of 3223 counties in our database.

Let’s try adding a new one.

1. Tap the NEW menu option.

Move to next step Æ

Here we are on a brand new ‘blank’ record. We


can now enter a new county and state. For
example, let’s add a fictious state called ZZ and a
county called abcDB.
To save our record, simply move to any other record
(ie. Tap the NEXT button.)

That was easy wasn’t it?

But wouldn’t it be nice to be able to select our STATE


abbreviation from a list instead of manually typing it in.
This would improve not only the speed of entry, but it
would also eliminate spelling mistakes.

Well, this is actually a VERY easy thing to accomplish.


Let’s do it now. First of all, click the (Close form)
button to return to the abcDB™ Main menu.

Then, select the frmCounties FORM and tap EDIT.

Move to next step Æ

43
I T ’ S A S E A S Y A S A - B - C !

Ok, here we are back ‘editing’ our Counties


form. Remember … we want to be able to
choose the STATE abbreviation from a list rather
than entering it manually.
One way of doing this is to use a DROPDOWN
control.

1. Select the STATE textbox.


2. Once you’ve ‘tapped’ the STATE textbox, you’ll see
that it has been surrounded with arrows that allow you
to move and resize the control:

Dragging the arrow allows you to MOVE this


object.

Dragging any of the other arrows that surround the


control allow you to resize the object.

You can experiment moving and sizing objects on your


own.

For now, notice that when you tapped the textbox, you
activated several things on the screen. You’ll now see
the Textbox:Textbox3 in the dropdown box near the
top of the screen. This dropdown box contains a list of
ALL the controls on your form. If you wish, you can
choose any control in the list in order to modify it.

Notice the properties button at the top of the


screen. The PROPERTIES page allows you to set all
sorts of parameters for each object on your form. We’ll
be getting back to this in just a minute.

Notice too though that there is now a DELETE


button. Let’s DELETE our State textbox.

44
I T ’ S A S E A S Y A S A - B - C !

Now would be a good time to show you the controls


at the bottom of the screen. See the 4 red arrows?
These allow you to move or resize your controls with
greater precision than simply ‘dragging’ them with your
stylus.

If the mover icon is displayed, the red arrows will


‘move’ your control(s) one pixel at a time in the various
directions.

If you tap the mover icon, it will change to the ‘sizer’


icon . When this is displayed, the red arrows will
allow you to change the size of your control one pixel
at a time.

Now let’s add a dropdown box in place of our


now deleted textbox.
1. Choose the STATE field from our Field Picker
2. Select the dropdown control .
3. Place the dropdown on your form. (Don’t add a
label this time when prompted)

Now we need to modify certain properties of our new


dropdown box.

1. Make sure the dropdown box has been selected.


2. Tap the Properties button to display all the
properties for our dropdown box.

For a detailed summary of all available


controls and their respective properties and
events, please see Appendix D
Move to next step Æ

45
I T ’ S A S E A S Y A S A - B - C !

To ‘populate’ our dropdown box with the list of


states, we have two options:
1. ENTER HARD-CODED LIST
In the SQL property, we could enter a hard-coded list
of items. For example, we could do something like this:

“AK,AL,AR,AS,AZ,CA”

We can enter any series of items, as long as they are


separated by commas and enclosed in double quotes.

This would work fine, but we’ve already got a table


that contains all the different states, why don’t we just
fill our dropdown box with all the records in that table?
Here’s how:

2. ENTER AN SQL STATEMENT


a. Tap the ‘…’ button at the far right side of the SQL
Property. This will open our SQL Builder

Here we are at the Query Builder that we


learned about earlier in this book. Here we can
quickly and easily create the query we need to
populate our new dropdown box.
In this case, we want to return all the STATE
abbreviations in the tblStates table. Notice that we’ve
also chosen to sort our state list alphabetically in
ascending order.

When we’re completed building our SQL statement,


click the RETURN button.

46
I T ’ S A S E A S Y A S A - B - C !

And VOILA! There is the necessary SQL


statement. Now all we have to do is tap the
CLOSE button at the bottom of the screen.
Move to next step Æ

Now when we run our form, look at what we’ve


got!
Now our STATE field allows us to choose from ALL the
abbreviations!

As you can see, creating forms in abcDB does not have


to be difficult. In this case we’ve created a perfectly
useable form in just a matter of minutes. However,
there obviously isn’t a lot of ‘power’ behind this form.
It doesn’t accomplish much other than viewing, editing
or adding States and Counties to our table.

The next chapter will delve into some of the deeper


aspects of abcDB programming … we’ll start learning
how to incorporate ‘script’ to make our forms very
powerful!

47
I T ’ S A S E A S Y A S A - B - C !

Let’s try something different now. Let’s practice adding


a TAB control to our form.

So first, save the current form, and then create a NEW


form. Call it frmTab.

You don’t need to use any tables for this exercise, so


just create a new MANUAL form.

You should end up with a blank form like this:

Now, select the TAB control from the toolbox.

48
I T ’ S A S E A S Y A S A - B - C !

And then place the Tab onto your form, just as we did
with the textboxes earlier in this lesson.

You should end up with something that looks like this:

Now, let’s assume that we want this form to allow us to


view inventory items. We’d like to show all the ‘basic’
inventory information on the first tab, more detailed
nd
information on the 2 tab, and finally a picture of our
rd
item on the 3 .

To create the necessary tabs, we simply need to open


the ‘properties’ for our tab. To ‘select’ the tab, you can
either tap on the tab, OR you can select it from the
dropdown list containing all our controls.

Once you’ve ‘selected’ the tab control, click the


PROPERTIES button .

49
I T ’ S A S E A S Y A S A - B - C !

Here is where we can add/delete/rename tabs.

Remember … we want to have 3 tabs for our inventory


application. Let’s add them by entering the following
st
in the TABS property (the 1 property in the list)

Basic,Detailed,Photo

When you’re done, click the CLOSE button to return to


designing our form:

VOILA!

There we have it! Our tab control is ready for us to


add controls to. So let’s do that now.

Let’s add one textbox to the BASIC tab:

First, select TEXTBOX from the toolbox at the top of


the screen, and then place the textbox onto the BASIC
tab:

50
I T ’ S A S E A S Y A S A - B - C !

Now, let’s add another textbox to the DETAIL tab.

So first, TAP on the ‘Detail’ tab of the tab control.

Now we’ll repeat the last couple of steps. When you’re


done, you should have something that looks like this:

51
I T ’ S A S E A S Y A S A - B - C !

Finally, let’s select the PHOTO tab, and add an IMAGE


control to it.

When you’re done, your screen should look something


like this:

When you SAVE and run your form, you’ll see what a
powerful tool the TAB control can be. There’s a
thousand uses for it, but we’ll leave the other 999 up to
your imagination!

Of course, we haven’t bound our textboxes to any


data, and we haven’t configured out ‘image’ control to
display anything, but you get the idea. Now that
you’ve created the form, you are half-way there!

4.3 Backing up and distributing your finished forms to other


PocketPC’s
Of course, once you’ve created an application that works well, you’ll likely want to create a
backup in case your PocketPC dies. You may also want to distribute your application to
other PocketPC’s which are running abcDB.

So let’s see how this can be accomplished.

NOTE: This section especially applies to customers who have not purchased abcDB ‘Desktop
Studio’. Desktop Studio allows you to create your abcDB solutions right from the
convenience of your desktop computer. If you do not have abcDB ‘Desktop Studio’, then
this section is very important.

52
I T ’ S A S E A S Y A S A - B - C !

Here we are on the FORMS


tab of our abcDB
REALTOR application (see
Chapter 5). Now that
we’ve created all our
forms, we want to make
sure that we’ve got a
backup in case our
PocketPC gets run over by
a truck!

Before continuing, please:

1. Exit abcDB

2. Cradle your
PocketPC and make
sure ActiveSync is
connected

Ok … Now you can move


to next step …

Let’s tap the EXPLORE


button so that we can view
the files which are
currently stored on our
PocketPC.

Move to next step …

53
I T ’ S A S E A S Y A S A - B - C !

Here we can see all the


files in our My Documents
folder. As you can see
we’ve highlighted
abcREALTOR.cdb.

Now, let’s COPY this file.


You can do so by either
using the FILE/COPY menu
or by using your CTRL-C
keyboard shortcut.

Once you’ve copied it,


move to the next step…

Now let’s double click the


My Computer icon on our
desktop and move to the
next step …

54
I T ’ S A S E A S Y A S A - B - C !

Here we see a list of all the


disk-drives on our
computer. Choose the one
you want to store your
database to, and double
click it.

I’m going to double-click


my C: drive.

Move to next step…

Once you’ve ‘browsed’ to


the appropriate disk-drive,
PASTE your PocketPC
database to this location
using the FILE/PASTE
menu OR by using the
CTRL+V keyboard shortcut.

As soon as you do, you


should see a screen similar
to this which indicates
ActiveSync is going to
‘convert’ your PocketPC
database to a MS Access
database.

Move to next step…

55
I T ’ S A S E A S Y A S A - B - C !

You will then be presented


with this screen.

Here we’re given the


opportunity to select which
tables we want to copy to
our desktop computer. In
this case, we’ve selected
ALL the tables.

Also, since this is only


going to serve as a backup
copy, we’ve UNCHECKED
the ‘Keep Tables
Synchronized’ option.

But before we click OK,


we need to specify the
LOCATION we want our
database copied to. We do
so by clicking the BROWSE
button and selecting the
folder we want it stored in.

As you can see, I’ve chosen


to store this copy to my
‘My Documents\abcDB
Backup’ folder. I’ve also
chosen to call this file,
abcREALTOR.

Once you’ve completed


this step, click the OK
button.

Proceed to the next step…

56
I T ’ S A S E A S Y A S A - B - C !

ActiveSync will now


‘convert’ your PocketPC’s
abcREALTOR database into
a MS Access database.

When it is completed, we’ll


quickly open our ‘\My
Documents\abcDB
Backup\abcREALTOR.mdb’
file in MS Access, just to
make sure it came over ok.

We’ll do that next…

(NOTE: If you have the


new ‘abcDB Desktop
Studio’ application, you can
open your database and
with it instead! See
www.PocketSOFT.ca for
more details.)

And here we are.

We can see that all our


tables came across just fine,
INCLUDING the 4 abcDB
‘system’ tables:

At this point, our


abcREALTOR database is
now safely backed up to
our desktop computer. If
you ever need to restore it
to your PocketPC, all you
need to do is ‘import’ this
copy back using the
instructions found in
section 3.2.

If you wish to see how you


can distribute the FORMS
and QUERIES to other
PocketPC’s, continue to the
next step.

57
I T ’ S A S E A S Y A S A - B - C !

You can see four abcDB


‘system’ tables in this
screenshot

xSysABCForm
xSysABCForms2
xSysABCObjects
xSysABCQueries

These four tables are very


important if you wish to
distribute an abcDB
application to other
PocketPC’s, as they contain
all the FORM definitions
and Query definitions that
you’ve created in abcDB.

For example, perhaps you


have a MASTER database
that contains the data you
wish to ‘import’ to your
various PocketPC’s.

The question is, how can


you ‘distribute’ the forms
you’ve created in abcDB
along with your data every
time you import your
MASTER database tables to
each PocketPC?

Let’s find out. Move to


next step …

58
I T ’ S A S E A S Y A S A - B - C !

The first thing we need to


do is open our MASTER
database in MS Access.
This screenshot shows all
the tables contained in my
Inventory Control database.

Now, assume that I have


already ‘imported’ all these
tables to my PocketPC and
have already created
abcDB Forms and queries
for viewing and entering
the data into these 9 tables.

The problem is that even


though I’ve created the
forms on MY PocketPC, if I
import this database to any
other PocketPC, the forms
I’ve spent hard work
creating will not be there
because those 4 magic
abcDB ‘system’ tables don’t
exist here!

The trick is that I need to


‘import’ the 4 abcDB
‘system’ tables into this
MASTER Inventory control
database.

How do we do that?

It’s simple. Move to next


step…

59
I T ’ S A S E A S Y A S A - B - C !

Assuming that I’ve already


completed the first 9 steps
of this tutorial, and have
COPIED my PocketPC’s
.cdb file to my desktop, all
I have to do is ‘import’ the
4 abcDB ‘system’ files from
that copy INTO my
MASTER database.

Here’s how:

1. Choose the
FILE/GET
EXTERNAL
DATA/IMPORT
menu option in
Access (as shown in
this screenshot)

2. When prompted,
choose the COPY
that you created in
steps 1-9.

Move to next step …

You are then presented


with all the tables
contained in that copy.
See the 4 abcDB ‘system’
tables?

SELECT those four tables as


shown here and then click
OK.

MS Access will then ‘COPY’


those four abcDB ‘system’
files into your MASTER
database, as can be seen in
the next screen shot…

60
I T ’ S A S E A S Y A S A - B - C !

THERE!

Now all of the forms and


queries we created in
abcDB are contained in our
MASTER database!

Whenever we ‘import’ this


database to our various
PocketPC’s, just make sure
to select these 4 xSysABC*
tables, and all your forms
and queries will be
transferred as well!

The only caveat to this is


that whenever you make a
change to any form or
query in abcDB you’ll need
to repeat this procedure.

61
I T ’ S A S E A S Y A S A - B - C !

5
Chapter

Chapter 5 -- Introduction to
Programming and Creating Forms

5.1 The Basics


Forms are the lifeblood of any abcDB™ application. They allow the user to input and edit
data the way that’s most appropriate for the situation. In this chapter, we’re going to
construct four applications.

1. First, we’ll create a very simple ‘HELLO WORLD’ application which will demonstrate
some simple ‘scripting’.

2. Secondly, we’re going to put together a much more advanced REALTOR application
suitable for Real-estate professionals. It will allow us to easily search for and find
properties that match certain user-defined criteria. It will allow us to display photos of
the homes.

3. Then we’ll create a program that’s not a database application at all! We’re going to
create a working CALCULATOR! Cool huh?

4. We’re then going to build the States’n’counties application that we reviewed in Chapter
4.

But first, let’s brush up on some basics:

Forms are made up of a variety of controls. Currently, abcDB™ supports the following
controls (See Appendix D for details on each control)

DROPDOWN controls TEXTBOX controls COMMAND buttons CHECKBOXES DATEPIC

62
I T ’ S A S E A S Y A S A - B - C !

GRID SCRIBBLE IMAGE LABELS

TAB TREEVIEW

Despite that fact that each of these controls are quite different, they all expose ‘properties’,
and react to certain ‘events’. As an abcDB™ ‘programmer’, you can create applications by
modifying their properties, and by creating ‘script’ code that is executed in these control
‘events’. You’ll see how this is accomplished later on in this chapter.

abcDB™ forms and the controls shown above contain MANY different properties. It may
seem overwhelming at first. You may wonder … “How can I possibly learn all of these
properties and events?!”

Fortunately, many of the properties you’ll find recur in many or all of the above controls. For
example, two properties that every control uses are TOP and LEFT. These two properties
obviously determine the location of the control. And EVERY one of abcDB™’s controls
contains these two properties. Not so tough huh?

First of all, to view the PROPERTIES of any control, all you need to do is the following:

1. EDIT an existing form OR create a NEW form.

2. Select the control you want to view properties for.

63
I T ’ S A S E A S Y A S A - B - C !

3. Tap the PROPERTIES button at the top of the screen. You’ll then be presented with
the PROPERTIES window … similar to the following screenshot:

As you can see in the above screen shot, we’re looking at some of the properties for a
TEXTBOX. You can see that there are HEIGHT, WIDTH, LEFT, and TOP properties, among
others. These 4 properties are common to all controls. Before proceeding, it would be
appropriate to examine the information found in Appendix D. There you will find ALL the
properties and events that can be utilized while building forms. When you feel comfortable
with the controls and their individual properties/events, come back here and continue.

5.12 Using TAGS in abcDB.


One of the other properties that is common to all the controls is the TAG property. TAG
names allow us to reference the various controls on our forms. For example, if we add a
textbox for entering CITY names, we could give that textbox a TAG name of CITY.
Thereafter, whenever we want to refer to the value contained in that textbox, we can use the
following syntax where we surround the TAG name with ‘tilde’ characters:

~CITY~

You’ll see how to use TAG names in our ‘hello-world’ application in just a few minutes.

If we want to reference the value in a FIELD on our form, we can use this syntax where we
surround the field name with braces {} (Note: these are not brackets!):

{fieldname}

64
I T ’ S A S E A S Y A S A - B - C !

5.13 Using VARIABLES in abcDB.


abcDB also allows you to use memory variables. There is one command that you need to
remember in this regard:

SETMEM(variableName // value)

You could for example, execute the next command to save the value in a textbox to the
variable named CustomerNumber:

SETMEM(CustomerNumber//~CustomerID~)

You refer to variables by surrounding the variable name with <! !>.

For example, if you then wanted to requery your form based on the CustomerNumber
variable, you could do something like this:

FORMREQUERY(“SELECT * FROM YourTableName WHERE CustomerID = “


<!CustomerNumber!>//1//”---“)

5.14 Using MODULES in abcDB.


Since the release of version 5.0, abcDB has supported code ‘modules’. What does this mean
for you? It means you can now ‘share’ and ‘re-use’ code!

Here’s how it works:

Whenever you’re editing a FORM, you can click the FORM properties, and you’ll find 5
properties called Module1,Module2,Module3,Module4,Module5. Each module can contain up
to 32,000 characters of code. These 5 modules are not specific to the form you’re editing.
They are available to EVERY form in your database.

Let’s look at a very ‘useless’ example. Perhaps your application will need to test the value of
a variable called VALUE and notify you of whether it is equal to 1,2,3, or else give you an
error message. Let’s also assume that you’ll need to perform this test MANY times throughout
your code!

Well, rather than duplicating the following lines of code EVERY time you need to run this test,
you can instead place this code in one of the modules, and ‘call’ it using the following
RUNSUB statement from anywhere else in your application:

RUNSUB(TEST_VALUE)

Notice that for this to work, you need to preface the block of code with the name of the
subroutine. Subroutine names are prefixed with a colon.

Whenever you want the subroutine to ‘return’ control to the calling code, you can use the
RETURN() statement.

65
I T ’ S A S E A S Y A S A - B - C !

:TEST_VALUE
TEST(<!value!>//=//1)
MESSAGE(“one”//”one”)
RETURN()
ENDTEST()
TEST(<!value!>//=//2)
MESSAGE(“two”//”two”)
RETURN()
ENDTEST()
TEST(<!value!>//=//3)
MESSAGE(“three”//”three”)
RETURN()
ENDTEST()
MESSAGE(“You did not enter a valid value!”//”ERROR”)
RETURN()

5.15 Proper syntax when entering SQL statements


Often when programming in abcDB it is necessary to enter SQL statements in the various
statements and functions. Sometimes it is confusing as to when you use single quotes,
double quotes, etc…

As an example, let's say you want to refresh your grid with all customers whose first
name includes the letter A. Of course, you are going to use the GRIDREFRESH
statement. In the next few examples we will only show the SQL portion of the
GRIDREFRESH statement.

You could easily do this with an SQL statement like this:

"Select * from Customers WHERE firstname like '%A%’"

Notice that the SQL statement needs to have opening and closing double quotes.
However, when abcDB actually 'executes' the statement, the double quotes are removed
leaving only:

Select * from Customers WHERE firstname like '%A%'

It gets tricky when you want to build your SQL statement dynamically. Let's say you
have a textbox on your form for entering the search phrase, and your textbox has a TAG
value of SEARCH.

If your user enters the letter A in the ~SEARCH~ textbox and then clicks the frefresh
button, you need to use this syntax:

"Select * from Customers WHERE firstname like '%" ~SEARCH~ "%'"

By inserting "~SEARCH~" into your sql, abcDB realized that ~SEARCH~ is not a literal part
of the sql statement since it is 'outside' of any double quotation marks. Hence abcDB

66
I T ’ S A S E A S Y A S A - B - C !

will first look for the value contained in the ~Search~ textbox and insert it before
executing the statement. In the end, if your user typed an A in the textbox, abcDB will
execute the following after removing all the double quotes:

Select * from Customers WHERE firstname like '%A%'

If you are dealing with number/integer fields, you do not use single quotes to surround
values. If you have a field called ID and it's a number field, you could do this:

Select * from Customer where ID = 1

However, if your ID field was a TEXT or a MEMO field, then you'd do this:

Select * from Customer where ID = '1'

If you have a date field, then you need to surround the value with ##'s like this:

SELECT * from Customer where BirthDate = #01/01/1950#

5.2 Creating our ‘Hello-World’ Application

The first abcDB application we’re going to construct is VERY simple, and yet it will demonstrate
some of the basic principals we’ll need to move on to bigger and better things. We’ll build our ‘Hello-
World’ program in two steps. First, we’ll simply make it possible to display a “HELLO WORLD”
message. Then, we’ll modify it slightly so that it will allow us to enter our name in a textbox and then
have it display a message stating “HELLO YourName!” So let’s get started …

First of all we need to create a new database, so do that now


(call it SAMPLE).

Once you’ve created your new database, move to the


FORMS tab and tap NEW to create a new form.

You’ll be presented with a screen like this one.

Let’s just tap the MANUAL FORM button. Call the form
HELLO, and click OK to continue to next step.

67
I T ’ S A S E A S Y A S A - B - C !

Now, let’s add a COMMAND button to our form. Place it


anywhere you please, similar to this screenshot. Just for
practice, let’s resize the button to make it larger.

Here comes the fun part. Let’s select the button, and open
it’s PROPERTIES page by tapping the
COMMAND1:PROPERTIES button at the top of the
screen. Here you can see all the different properties that we
can set for this particular button.

For now, we’re only interested in three of these properties.


The ‘CAPTION’, ‘ON CLICK’ and ‘FONT’ properties.

Let’s change the CAPTION so that the button will display


the words “Click Me!”.

Now, let’s click the button on the FONT property line,


and move to the next step.

68
I T ’ S A S E A S Y A S A - B - C !

Ok, here we are at the ‘font dialog’. Let’s change the FONT
SIZE to 14 and click OK.

Let’s SAVE our PROPERTY changes, and see what our


command button looks like now.

That’s better! Now I can see it without my glasses!!


YAHOO!

But we’ve still got more work to do before our fancy button
will actually do anything. Let’s go back into the properties
again for our button.

69
I T ’ S A S E A S Y A S A - B - C !

We’re now going to focus our attention on the ON CLICK


property. The script that you enter in the ON CLICK
property of a COMMAND button will be executed every
time that the button is ‘tapped’.

Let’s select it in the list of properties, and then we’ll click


the button to open the SCRIPT BUILDER form.

This screen is the ‘center of operations’ when it comes to


programming abcDB using ‘script’ code. Let’s look at
some of the features on this screen.

First of all, there are some ‘shortcut’ buttons that allow us to


enter characters which are often used in programming.
Characters such as ~ ( ) //.

There is also a button which will take us to an SQL Builder


(see chapter 4.2)

Along the bottom of this screen, there are 4 other buttons.


Each displays a list of commonly used CMDS
(Commands), FUNCTIONS, OBJECTS or FIELDS.

For now, let’s tap the CMDS button.

70
I T ’ S A S E A S Y A S A - B - C !

Here you can see the list of commands available in the


abcDB ‘Script’ language. Among the MANY different
commands, is one called MESSAGE. We’ll choose it from
the list, and as you can see, the command is entered for us.

Notice that all the commands shown in the command list are
accompanied by the basic syntax required in order to make
them work. This will help ‘jog’ your memory. If you need
more advanced help, you can always refer to the
Appendixes in this manual.

In any case, notice that the syntax for our MESSAGE()


command is as follows: MESSAGE(Text // Caption)

To achieve our goal of having a “HELLO WORLD”


message being displayed, we’ll need to modify our code
slightly, as can be seen in the next step.

Now, whenever our COMMAND button is tapped, this


code will be executed, causing abcDB to display our
“HELLO WORLD!” message.

Let’s try it out by saving everything:

1. Tap SAVE on this screen to save our script.

2. Tap CLOSE on the following screen to save our


PROPERTIES

Once you’ve saved your form, let’s run it by selecting it in


the list of forms on the FORMS tab, and tapping OPEN.

71
I T ’ S A S E A S Y A S A - B - C !

If we’ve followed the steps accurately, when we ‘tap’ the


button, we should see a message as shown in this
screenshot.

Congratulations! You’ve just created your first abcDB


‘Application’! Granted, it doesn’t do much, but you’ve
been able to learn some of the basic essentials used in
creating MUCH more powerful programs.

Wouldn’t it be cool though, if we could enter our name in a


‘textbox’ and then get abcDB to display a ‘personalized’
Hello World message?

Let’s do that now.

First, close this form, and then EDIT it. Meet you on the
next step.

Let’s add a ‘textbox’ to our form. When prompted, answer


YES, and add a label as well. Position them both similar to
what’s shown here.

Let’s make the following changes to the LABEL’s


properties:

- Change the CAPTION to “Enter name:”

Then, make the following change to the TEXTBOX’s


properties:

- Change the TAGNAME property to NAME

72
I T ’ S A S E A S Y A S A - B - C !

Finally, let’s modify the script code in the COMMAND


button’s ONCLICK property to read like this:

MESSAGE(“HELLO “ ~NAME~//”abcDB”)

Notice that we’ve taken advantage of the OBJECTS button.


It displays a list of all the different controls that are currently
on our form. Our textbox (we just changed it’s TAGNAME
property to NAME) is listed, and when we select it, it is
entered in our code for us.

Basically, what we’re expecting these changes to do, is to


cause abcDB to display HELLO followed by the text that’s
contained in the textbox with the TAG name of NAME.

After you’ve made all these changes, SAVE your form, and
open it.

Let’s test it out: Enter some text for a name, and then tap
the button.

PRESTO!

But wait a minute … I still realize that this doesn’t rank as


one of the top 10 applications ever designed. But Rome
wasn’t built in a day eh? (oops. A bit of my Canadian
heritage coming out there. Sorry eh?!)

So let’s look at something more substantial. Our next


sample application, the ‘abcDB REALTOR’ program, will
encompass many more features, and will accomplish much
more than our simple “Hello World” program.

5.3 Creating The abcDB™ REALTOR Application

Although we can create tables from within abcDB™, it is often very useful to start by creating the
necessary database tables from within MS Access on your desktop computer (or any of the other
ODBC compliant databases that work with ActiveSync). Many times, the necessary data is already

73
I T ’ S A S E A S Y A S A - B - C !

existing on the desktop, in which case you could simply begin by ‘importing’ it to your PocketPC
(See Chapter 3.2)

For the purpose of this tutorial, we’re going to start from scratch and we’re going to construct all of
our tables from within MS Access. Our application is going to consist of the following 4 tables:
(NOTE: For information on creating tables, please see Appendix F.)

Table Name Field Name Field Type Field Size Index

tblCities ID AutoNumber Long Integer PRIMARY


KEY

City Text 50

Table Name Field Name Field Type Field Size Index

tblStates ID AutoNumber Long Integer PRIMARY


KEY

State Text 50

Table Name Field Name Field Type Field Size Index

tblStyles ID AutoNumber Long Integer PRIMARY


KEY

Style Text 50

Table Name Field Name Field Type Field Size Index

tblListings ID AutoNumber Long Integer PRIMARY


KEY

Address Text 50

SteetAve Text 50

StreetType Text 50

City Text 50

74
I T ’ S A S E A S Y A S A - B - C !

State Text 50

Zip Text 50

MLS Text 50

Size Number Long Integer

Style Text 50

Price Currency

Taxes Currency

Bedrooms Number Long Integer

Bathrooms Number Long Integer

Pool Yes/No

Garage Text 50

ListingDate Date/Time

Description Memo

Sketch Memo

As soon as you’ve created these 4 tables in MS Access, save your database. The next step is for us to
‘import’ these tables to our PocketPC. For detailed instructions on importing tables to your device,
please see Chapter 3.2

75
I T ’ S A S E A S Y A S A - B - C !

Once you’ve imported this database to your PocketPC, open it in


abcDB™. You’ll see your four tables as shown here:

If we wanted to, we could simply view and edit our data by


opening and closing the tables. For example, let’s open the
TBLLISTINGS table:

As you can see, I’ve added some sample data into the tblListings
table.

Obviously, finding and viewing our data this way is less than ideal.
It’s very cumbersome and non-intuitive. So let’s get cracking and
we’ll start designing our abcDB REALTOR application.

First of all, let’s click on the FORMS tab, and we’ll create a NEW
form. When prompted for a table, choose the tblListings table.

We will call this form, frmSearch.

Proceed to the next step.

76
I T ’ S A S E A S Y A S A - B - C !

Let’s start this application by creating a search form. Let’s add the
following controls to the form:

CONTROL TYPE Caption TAGNAME

LABEL Address Label1


LABEL Street Label2
LABEL City Label3
LABEL Max. Size Label4
LABLE Max. Price Label5
TEXTBOX ADDRESS
TEXTBOX STREET
TEXTBOX SIZE
TEXTBOX PRICE
DROPDOWN CITY
COMMAND Search butAddress
COMMAND Search butStreet
COMMAND Search butCity
COMMAND Search butSize
COMMAND Search butPrice
GRID n/a GRID1

The idea here is this:

We want to allow our user to enter either an Address, or a Street, or


a City, or a Maximum Size, or a maximum Price. By tapping the
SEARCH button below the appropriate field, we’ll then fill the
GRID control with houses that match that criteria. For example,
our user could enter MARSHALL in the City field, and then tap the
CITY SEARCH button, and all houses that are located in
MARSHALL would be displayed in the GRID.

77
I T ’ S A S E A S Y A S A - B - C !

Let’s open the PROPERTIES for our city SEARCH button. In the
ONCLICK property we’ll add the following code: (NOTE: The
following command must be entered all ON ONE LINE.)

GRIDREFRESH(“SELECT ID,Price,Style,
address,StreetAve,StreetType,City FROM
tblListings WHERE City = ‘”~CITY~”’”// //
//”---“// // //)

It’s easy to understand what this command will do. When the user
enters a city name and taps SEARCH, abcDB will refresh the
GRID’s contents with all records where the CITY equals the city
entered by the user.

Let’s try our form out. SAVE it using the name ‘frmSearch’ and
then open it.

After entering the city of MARSHALL and tapping SEARCH,


here are the results. Pretty neat eh?

Now things are starting to get exciting! We can start imagining all
the possibilities! But let’s complete building this form before we
put the ‘cart before the horse!’

Let’s edit our form again, and we’ll finish the code behind the other
4 SEARCH buttons.

78
I T ’ S A S E A S Y A S A - B - C !

Add the following code behind the ONCLICK event property of


the following command buttons: (Make sure every
GRIDREFRESH command is on ONE LINE! Do not add carriage
returns!)

butAddress:
GRIDREFRESH(“SELECT ID,Price,Style,
address,StreetAve,StreetType,City FROM
tblListings WHERE Address LIKE
‘%”~ADDRESS~”%’”// // //”---“// // //)

Notice that we’ve used the LIKE operator in


this SQL. This allows our user to enter a
‘partial’ address. Basically this gives us
a ‘wildcard’ search.

butStreet
GRIDREFRESH(“SELECT ID,Price,Style,
address,StreetAve,StreetType,City FROM
tblListings WHERE StreetAve LIKE
‘%”~STREET~”%’”// // //”---“// // //)

butSize
GRIDREFRESH(“SELECT ID,Price,Style,
address,StreetAve,StreetType,City FROM
tblListings WHERE Size <= ”~SIZE~// // //”--
-“// // //)

butPrice
GRIDREFRESH(“SELECT ID,Price,Style,
address,StreetAve,StreetType,City FROM
tblListings WHERE Price <= ”~PRICE~// //
//”---“// // //)

When you’re done, save your form and test it. You should find that
you can enter all the various search criteria and find results.
AWESOME!

If you get any errors, review all the steps to this point to ensure you
didn’t make any typographical errors.

79
I T ’ S A S E A S Y A S A - B - C !

You notice however, that we really don’t need the NAVIGATION


MENU at the top of the form. We also really don’t need the
horizontal scrollbar OR the vertical scrollbar. So let’s get rid of
these by editing the form again and changing the following
properties for the FORM by tapping the properties button and then
choosing FORM from the dropdown list at the top of the properties
screen:

Caption: SEARCH
NavigationMenu: NO
Scrollbar(Horiz): NO
Scrollbar(Vert): NO
Close Button?: YES

After saving these changes, our form should look like this. Much
better!

If you want, you can change the background and foreground colors
of the form and of all the controls. Since everyone has their own
opinions of what ‘looks good’, I’ll leave the colors up to you.

Now, after we’ve searched for our houses, wouldn’t it be nice to be


able to choose one from the list and then view it in more detail?

No problemo! Let’s edit our form again, and I’ll meet you at the
next step….

Ok, so what we want to do is this:

1. Choose a house from the list.

2. Once chosen, we want to display a BUTTON that displays


a caption like “Show House#12”

3. When we click this button, we’d like to open a new form


which will show the details of this home.

How are we going to do this? Well, let’s start by adding a button as


shown here. Set it’s VISIBLE property to NO so that we won’t
normally be able to see it. Give it a TAGNAME of butZOOM

Now, the key to being able to view the details of a particular home
is the ID field. Remember, every home will have a unique ID.
And in our GRID control, the ID field is the first field displayed, so
we can use the GRIDCOL() function to find out what it is!

80
I T ’ S A S E A S Y A S A - B - C !

In the ON CURRENT event of the GRID control, enter the


following code:

SETMEM(HouseID//GRIDCOL(0))
CAPTION(butZOOM//”Show House#”<!HOUSEID!>)
VISIBLE(butZOOM//TRUE)

Whenever a user taps into a new row (or cell) in the GRID, the ON
CURRENT event fires. As you can see, a memory variable named
HouseID is then given the value that is contained in the first
column of the currently selected grid row.

Then, we change the caption of the butZOOM button so that it


explains which house number you’re going to view.

Finally, we make the butZOOM button VISIBLE, so that the user


can see it.

After you save your form, you can see it works pretty slick! But
our SHOW HOUSE button still doesn’t do anything.

Before we do anything further, let’s create a NEW form based on


the tblListings table. Let’s call this form ‘frmListing’

This form is going to allow us to view the details of each home, as


well as view the photograph of the property. In addition to this,
we’re going to allow the user to ‘sketch’ diagrams, take notes, etc..
by incorporating a SCRIBBLE control.

We’re going to build it so that initially the photograph is displayed,


but if the user wants to display the ‘sketch’, he/she only has to tap
the SKETCH button, which will then ‘hide’ the photo, and ‘show’
the ‘sketch. To view the photo again, the user will just tap the
button again.

Add textboxes and labels so that it resembles our screenshot here.


Make sure that your textboxes are all bound to the appropriate
fields, by selecting the proper field in the top-right dropdown
before adding the control.

You can also see that we’ve added a SCRIBBLE control and an
IMAGE control. Overlap them slightly so that you can still select
each one if needed. Set the VISIBLE property of the SCRIBBLE
control to NO, since we want it to initially be invisible.

Set the VISIBLE property for the CLEAR and SAVE buttons to
NO.

81
I T ’ S A S E A S Y A S A - B - C !

Set the BOUND FIELD property of the Scribble control to the


SKETCH field.

Set the FORM’s properties to this:

Background Color: 0,128,0


Caption: HOME DETAIL
NavigationMenu: YES
Scrollbar(Horiz): YES
Scrollbar(Vert): YES
Close Button?: YES

Save your form and proceed to the next step.

Let’s just test our frmListings form to make sure it works. As long
as your table contains data, you should see something similar to this
screenshot.

Don’t proceed until you’ve gotten this form to work.

82
I T ’ S A S E A S Y A S A - B - C !

Now, let’s make our SKETCH button work. Here’s how:

In the ON CLICK event of the SKETCH button, enter this code:


(Note: it is possible that when building this form you have used TAG names
different from those shown. Make sure you use the proper tag names as you have
entered them. For example, here we gave our scribble control a tag name of
Scribble2. Your scribble control might be called scribble1 or something else)

TEST(<!IMAGE!>//=//1)
CAPTION(Command2//Picture)
VISIBLE(Image2//false)
VISIBLE(Scribble2//true)
VISIBLE(butclear//true)
VISIBLE(butsave//true)
SETMEM(IMAGE//0)
EXIT()
ENDTEST()

CAPTION(Command2//Sketch)
VISIBLE(Image2//true)
VISIBLE(Scribble2//false)
SETMEM(IMAGE//1)
VISIBLE(butclear//false)
VISIBLE(butsave//false)

In the ON OPEN event of the FORM, enter this code:

SETMEM(IMAGE//1)

In the CLEAR button’s ON CLICK event, enter this:

SCRIBCLEAR()

And in the SAVE button’s ON CLICK event, enter this:

SCRIBSAVE()

In the FORM’s ON CURRENT event, enter this code which will


automatically attempt to load the corresponding image for the
currently select house ID (ie. 1.bmp, 2.bmp, etc…):

IMAGE(LOAD//"/My Documents/” {ID} “.BMP")

Now let’s save our FORM and test it out…

83
I T ’ S A S E A S Y A S A - B - C !

And here we are!

As long as you have a BMP file in the My Documents folder that is


named the same as the currently selected ID field value, then you
should see a picture!

Let’s draw a quick sketch by tapping the SKETCH button.

If we’ve done everything correctly, we should be able to SAVE our


sketch by tapping the SAVE button. The next time we view this
record, our sketch will still be here for us to view.

Of course, if we make a mistake, we can always tap the CLEAR


button, to clear the scribble control so we can start over!

Cool isn’t it?

84
I T ’ S A S E A S Y A S A - B - C !

Ok, now that our frmListings form is working fine, let’s go back
and edit our frmSearch form. Here we are again.

Remember, our next task is to make the butZOOM button work.

We’ve already programmed our GRID’s ON CURRENT event to


capture the ID of the house we’ve tapped on, and store it in a
memory variable named HouseID.

Now we want our butZOOM button to open our new frmListings


form and have it display the record that matches our HouseID
value. Here’s how:

In the ON CLICK event of our butZOOM button, enter the


following:

FORMOPEN("frmListings"//"select * from tblListings where ID =”


<!HouseID!>//1//"---"////)

For details on the FORMOPEN syntax, refer to the Appendix.

Now let’s save our form and test it again.

Let’s search for all homes that are in the city of Marshall.

After selecting a home in the list, let’s tap the SHOW HOUSE
button, and see if our program is working.

Move to next step.

85
I T ’ S A S E A S Y A S A - B - C !

Yahoo!!!! It’s working!

I’ll admit that we could certainly spend some time to make our
application ‘look’ more aesthetically pleasing, but the fact remains
that it’s working fine.

There are many things that we could do. For example, on this
screen, we need to make the SEARCH button take us back to our
frmSEARCH form. This is easily accomplished. Can you think of
how?

All we need to do is add this code in the buttons ONCLICK event:


FORMOPEN("frmSEARCH"////1//"---"////)

We could also add the ability to display photographs of our houses.


How can we do that?

Move to the next step.

Well, let’s start by editing our frmSEARCH form and adding an


IMAGE control. We’ll resize and move our butZOOM button so
that there’s room. Set the IMAGE controls STRETCH property to
YES.

Now, let’s add the following line of code to the bottom of our
GRID’s ON CURRENT event:

IMAGE(LOAD//"/My Documents/” <!HOUSEID!> “.BMP")

Now, whenever we tap in the grid, we’ll set our memory variable to
the value of the selected House ID, we’ll make our butZOOM
button visible, AND now we’ll load the image of the house into the
image control.

Note: In order for this to work, it is assumed that you have copied
your pictures (*.bmp files) to the /My Documents folder on your
device, and that they are named according to the ID# of the house.
(ie. 1.bmp, 2.bmp, 3.bmp, etc..)

Let’s save our form, copy a valid *.BMP file to our /My
Documents folder and test it out.

86
I T ’ S A S E A S Y A S A - B - C !

WOW! Now we’re accomplishing some pretty cool stuff.

Obviously, we would probably want to tidy up our forms and make


them more user-friendly, but this should give us a pretty good idea
of what’s possible. And granted, I’m not the best photographer in
the world, but I guess that’s why I’m not being published in
‘National Geographic’!

But we’re not finished yet.

Why don’t we modify our frmListings form so that we can easily


add new listings into our database?

Let’s EDIT our frmListings form and go to the next step.

Let’s give our CITY textbox a TAG name of CITY.

In the CITY Label’s ON CLICK event, add this code:


(Notice how we’re taking advantage of the abcDB QUERY
BUILDER to easily create the necessary SQL statement?)

POWERPICK(CITY//"SELECT tblCities.city FROM tblCities order by


tblCities.city ASC“//”---“//)

Also note that our SQL statement in the PowerPick command will
return our city list in alphabetical order. This will make it much
easier for our users to find the city they want, especially when there
may be dozens to choose from.

It would also be a good idea to change the CITY label’s caption to


“City …” You’ll see why in a moment.

Save your form, and let’s test it out.

87
I T ’ S A S E A S Y A S A - B - C !

Let’s tap the ADD NEW menu button, and we should be presented
with a brand new ‘blank’ record.

Now, let’s try tapping the ‘City …’ label. See what happens?
We’re presented with a POWERPICK, a new feature of abcDB.
PowerPicks allow your users to quickly and easily choose values
from a list.

I’ll choose MARWAYNE from the list and tap OK.

By the way, see why we changed the label’s caption to “City …”?
The three dots help our users to recognize that this is no ordinary
label control. They’ll begin to realize that whenever they see a
label with 3 dots in our applications that it means there’s a
PowerPick waiting to be used!

Move to next step …

Notice how the PowerPick has now filled in our CITY textbox with
the value I chose.

We could EASILY add a PowerPick to every other field on our


form! For example, our STYLE, STATE, STREETYPE,
BEDROOMS, and BATHROOMS fields would be prime
candidates for using a PowerPick since they are all fields that
obtain their values from a predefined list of items.

PowerPick’s save your user time, and they make data entry more
accurate with fewer spelling errors.

Hmmm … what else can we add to our application? How about a


main menu? This should be EASY for professional programmers
like you and me! Let’s create a NEW form (not based on a table),
and proceed to the next step.

88
I T ’ S A S E A S Y A S A - B - C !

Ok, I couldn’t resist. I threw in some color on this screen too. Of


course, we could get real fancy if we wanted, and display a picture,
or even add some sound using the PLAYSOUND() command. But
I’ll leave that up to you.

Let’s add a LABEL with the caption “abcDB REALTOR”, and


also add 3 COMMAND buttons, just as is shown here.

In the SEARCH button’s ONCLICK event, enter this:

FORMOPEN("frmSEARCH"// //1//"---"////)

In the BROWSE button’s ONCLICK event, enter this:

FORMOPEN("frmListings"// //1//"---"////)

In the EXIT button’s ONCLICK event, enter this:

EXITAPP()

We won’t be needing any scrollbars on this main menu, so let’s


disable them, as well as remove the navigation menu.

Also, since we would like this MAIN MENU to automatically


appear whenever this database is opened, let’s set the AUTO
START property for this form to YES.

Well, that brings us to the end of our abcDB REALTOR


application. There’s still LOTS that we could add. Just a few
suggestions might be:

1. Forms to add new Cities, States, House Styles, etc…

2. We could add forms which display more details relating to


the REALTOR who listed each particular home.

3. If we had abcDB ‘Wireless’, we could easily convert this


application so that it retrieved the data from a remote
computer located anywhere in the world!

The SKY’S THE LIMIT!

Hopefully, if nothing else, you’ve learned some more techniques


that can be used to develop your own abcDB applications.

89
I T ’ S A S E A S Y A S A - B - C !

5.4 Creating our ‘abcDB CALCULATOR’ Application

This application will really drive home the ability of abcDB to create powerful working
PROGRAMS. In the next few minutes, we’re going to develop a full working calculator using some
more abcDB ‘magic’.

So, let’s get started!

Create a new form. Do not base it on any table. Call it


‘Calculator’.

Add the following controls as shown in the screenshot:


CONTROL TYPE Caption TAG
TEXTBOX DISPLAY
LABEL Root lblRoot
LABEL 1/x lblFraction
LABEL M+ lblMemPlus
LABEL <- lblBackspace
LABEL % lblPercent
LABEL MC lblMemClear
LABEL MR lblMemRecall
LABEL Clear lblClear
LABEL 1 lblOne
LABEL 2 lblTwo
LABEL 3 lblThree
LABEL 4 lblFour
LABEL 5 lblFive
LABEL 6 lblSix
LABEL 7 lblSeven
LABEL 8 lblEight
LABEL 9 lblNine
LABEL 0 lblZero
LABEL . lblDecimal
LABEL = lblEquals
LABEL + lblPlus
LABEL - lblMinus
LABEL * lblMultiply
LABEL / lblDivide

90
I T ’ S A S E A S Y A S A - B - C !

Now, let’s add the code necessary to make our ‘keys’ work.
We’ll program the 0-9 keys, and the + - * / . keys.
CONTROL Code to place in ON CLICK event.
lblOne SETVALUE(~DISPLAY~//~DISPLAY~ “1”)
lblTwo SETVALUE(~DISPLAY~//~DISPLAY~ “2”)
lblThree SETVALUE(~DISPLAY~//~DISPLAY~ “3”)
lblFour SETVALUE(~DISPLAY~//~DISPLAY~ “4”)
lblFive SETVALUE(~DISPLAY~//~DISPLAY~ “5”)
lblSix SETVALUE(~DISPLAY~//~DISPLAY~ “6”)
lblSeven SETVALUE(~DISPLAY~//~DISPLAY~ “7”)
lblEight SETVALUE(~DISPLAY~//~DISPLAY~ “8”)
lblNine SETVALUE(~DISPLAY~//~DISPLAY~ “9”)
lblZero SETVALUE(~DISPLAY~//~DISPLAY~ “0”)
lblPlus SETVALUE(~DISPLAY~//~DISPLAY~ “+”)
lblMinus SETVALUE(~DISPLAY~//~DISPLAY~ “-”)
lblMultiply SETVALUE(~DISPLAY~//~DISPLAY~ “*”)
lblDivide SETVALUE(~DISPLAY~//~DISPLAY~ “/”)
lblDecimal SETVALUE(~DISPLAY~//~DISPLAY~ “.”)

Basically, the SETVALUE command in each label will take


the current value contained in the DISPLAY textbox, and
will append the appropriate character.

If we wanted to get REAL fancy, we could play a different


sound when each key is tapped by adding something like
this in each keys ONCLICK event:

PLAYSOUND(“/My Documents/MySound.wav”//1)

But I’ll leave that up to you.

For now, let’s SAVE our form and we’ll test it out.

Cool! It works! We can enter numbers and calculations.

Unfortunately, pressing the “=” button doesn’t do anything,


so our calculator is still pretty much useless! So let’s fix this
now.

In the ON CLICK event of the lblEquals control, enter the


following code:

SETVALUE(~DISPLAY~//eval(~DISPLAY~))

This will evaluate the currently displayed expression and


store the result in our DISPLAY textbox.

Try it out and you’ll see that it works.

But for now, let’s get our other function keys working on
our calculator…

91
I T ’ S A S E A S Y A S A - B - C !

Enter the following code in the controls specified:


CONTROL Code to place in ON CLICK event.
lblRoot SETMEM(ROOT//SQR(~DISPLAY~))
SETVALUE(~DISPLAY~//<!ROOT!>)
lblPercent SETMEM(PERCENT//~DISPLAY~/100)
SETVALUE(~DISPLAY~//<!PERCENT!>)
lblFraction
SETMEM(FRACTION//1/~DISPLAY~)
SETVALUE(~DISPLAY~//<!FRACTION!>)
lblMemClear SETMEM(MEMORY//0)
lblMemAdd SETMEM(MEMORY//<!MEMORY!> +
~DISPLAY~)
lblMemRecall SETVALUE(~DISPLAY~//<!MEMORY!>)
lblBackspace SETMEM(LENGTH//LEN(~DISPLAY~))
SETMEM(A//<!LENGTH!>-1)

SETVALUE(~DISPLAY~//LEFT(~DISPLAY~,<!A!>))
lblClear SETVALUE(~DISPLAY~//)

Once you’ve saved these changes and run the program, you
should be able to use our calculator to perform calculations.
This screen shot shows the results of entering 19.89 * 5.

Even our memory keys work!

So you can see from this little exercise some more evidence
that abcDB truly is a powerful ‘mobile’ programming
language!

5.5 Creating our ‘States’ Application

The States’n’Counties application demonstrates how to create a one-many relationship by using a


GRID control.

Before we begin building the FORM though, let’s create the necessary tables.

Table Name Field Name Field Type Field Size Index

tblAreaCodes State Text 7

AreaCode Text 6

Table Name Field Name Field Type Field Size Index

tblCounty State Text 2

92
I T ’ S A S E A S Y A S A - B - C !

County Text 25

Table Name Field Name Field Type Field Size Index

tblStates TimeZone Text 50

FullStateName Text 30

Capitol Text 14

State Text 2

Now that we have our tables setup, let’s create our form:

Create a NEW form and base it on your tblStates table.


Call it frmMain.

Then, as shown in this screenshot, add the following


controls:
CONTROL TYPE CAPTION TAGNAME BOUNDFIELD
LABEL SEARCH
LABEL Full Name
LABEL Capitol
LABEL Time Zone
COMMAND HELP
COMMAND Area Codes
COMMAND Counties
COMMAND Search State
Names
COMMAND Search Capitol
TEXTBOX SEARCH
TEXTBOX StateName
TEXTBOX Capitol
TEXTBOX TimeZone
GRID

After adding all these controls, save your form and try
running it …

93
I T ’ S A S E A S Y A S A - B - C !

If you’ve done everything correctly, you should be able to


view/edit/add data. Here we see the record for Montgomery
Alabama.

But really, the only functionality we have are the 3 bound


textboxes right? None of the buttons work, and the GRID is
still empty.

So let’s work on our GRID control first.

Move to the next step …

Open the PROPERTIES for the GRID control, and enter the
following:

SQL Property:

“SELECT areacode,state FROM


tblAreaCodes WHERE state = ‘” {state}
“’”

In the LINK FIELD (CHILD) Property, enter STATE

In the LINK FIELD (Master) Property, enter STATE

The LINK FIELDS will ensure that a user cannot change


the STATE field in your grid. This will help ensure the
referential integrity of your data.

In addition, if a user decides to ADD a new record in the last


row of the GRID (assuming you’ve enabled the ALLOW
ADDING property), abcDB will automatically enter the
value of the LINK FIELD (Master) field.

Let’s see this in action. SAVE your changes, and save the
form. Then OPEN your form and move to the next step.

94
I T ’ S A S E A S Y A S A - B - C !

Now, here we are back on Montgomery Alabama’s record.


This time, notice that our grid contains all the area codes for
Alabama.

Let’s try adding a new areacode in our GRID.

See the ? button in the top left corner of the grid? Tap it,
and select the ADD option. (NOTE: You can only add or
delete records if you’ve enabled these properties for your
datagrid.)

A new record will now be added to the last line in the grid.
Notice that abcDB has automatically entered AL in the
STATE column!

Try editing one of the STATE fields in our GRID. Due to


the fact that we’ve set up the LINK FIELD properties,
you’ll find that this field is effectively READ ONLY.

You’ll also notice that if you move forward and backward


using the menu buttons on the bottom of the screen, our
GRID is automatically refreshed to display the appropriate
records!

But what about all the other buttons on our form?

Let’s get our two SEARCH buttons working now …

95
I T ’ S A S E A S Y A S A - B - C !

In the SEARCH STATE NAMES command button, add the


following code to the ONCLICK event: (Note: This should
all be entered on ONE line!)

FORMREQUERY(“SELECT * FROM tblStates


WHERE FullStateName LIKE ‘%” ~SEARCH~
“%’”//1//”---“)

In the SEARCH CAPITALS command button, add the


following code to the ONCLICK event: (Note: This should
all be entered on ONE line!)

FORMREQUERY(“SELECT * FROM tblStates


WHERE Capitol LIKE ‘%” ~SEARCH~
“%’”//1//”---“)

Now, if we SAVE and OPEN our form, we can enter a


search string in our SEARCH textbox, and then find any
STATE or CAPITAL that contains our search text.

In this screenshot, I’ve searched for any State whose name


contains the letters NEW. As you can see, there were 4
matches, the first of which is New Hampshire.

Of course, our SEARCH CAPTITALS button works


equally as well.

But what about our HELP, AREA CODES, and


COUNTIES buttons?

Let’s work on them now …

96
I T ’ S A S E A S Y A S A - B - C !

In the HELP command button’s ONCLICK event, add the


following code. (Note: This should all be entered on ONE
line!)

MESSAGE(“Enter a search phrase and then


tap the appropriate search
button”//”abcDB States”)

In the AREA CODES command button’s ONCLICK event,


add the following code. Notice that when we refresh the
grid using the command, we are actually populating it with
TWO fields (areacode and state) but we’re making the 2nd
field invisible by setting it’s column width to zero. (Note:
This should all be entered on ONE line!)

GRIDREFRESH(“SELECT areacode,state FROM


tblAreacodes WHERE state = ‘” {state}
“’”// // //”---“// // //3000,0)

In the COUNTIES command button’s ONCLICK event,


add the following code. Notice that when we refresh the
grid using the command, we are actually populating it with
TWO fields (County and State) but we’re making the
STATE field invisible by setting it’s column width to zero.
(Note: This should all be entered on ONE line!)

GRIDREFRESH(“SELECT county,state FROM


tblCounty WHERE state = ‘” {state}
“’”// // //”---“// // //3000,0)

Now if we SAVE and OPEN our form, we can choose to


view either the selected state’s areacodes OR counties!

5.6 Using ‘SUBFORMS’ in abcDB.


Subforms add a VERY powerful feature to abcDB. Every form you create can now contain up
to 6 different datasources … the datasource your form is bound to, and 5 others that are
referred to as ‘subforms’. Every control on your form can be ‘bound’ to any of these 6
datasources.

What does this mean? Well, prior to subforms, you could display data from ONE table at a
time. For example, you could create a form that contained data from your ‘CUSTOMERS’
table.

97
I T ’ S A S E A S Y A S A - B - C !

But now, with the power of ‘subforms’, you can add information from your ‘Accounts
Receivable’ table, your ‘Inventory’ table, etc..! All on the same form!

So the big question is … HOW DO I DO IT?

Let’s look at a very simple example:

First, let’s start by making a new form in our REALTOR


database.

Let’s create this manual form basing it on the table


‘tblCities’, and we’ll call our new form SUBFORMS.

So let’s quickly add the following controls to the form.

Make sure that the textbox bound to the CITY field is given
a TAGNAME value of CITY.

This will obviously give us a VERY simple form that only


displays a city name and it’s associated ID. Not very fancy!

But let’s open the FORM properties, and go to the next step.

We’re about to experience the power of ‘subforms’!

98
I T ’ S A S E A S Y A S A - B - C !

Let’s add an SQL statement for our ‘Subform1 Data’


property. Please tap the ‘…’ button and proceed to the next
step.

Ok. Here we are at our Query Builder.

Now, choose the tblListings table, and then select ALL the
fields (ie. The *)

When done, tap the RETURN button and proceed to next


step.

99
I T ’ S A S E A S Y A S A - B - C !

OK!

Now we’ve got a valid SQL statement entered for our


SubForm1 datasource.

So basically, our SubForm1 will contain ALL the records


from our tblListings table. Not too useful yet … but we’re
not done yet!

Let’s tap OK in the top right corner of screen and go to the


next step.

THERE!

Now, notice what we find when we tap the dropdown list


that contains all available data fields! We have a whole
bunch of new ones!

Notice that some of them are prefixed with :1:

For example, notice the :1:City field. This indicates that the
field is contained in the Subform#1 datasource. If we had
added SQL statements for the other 4 SubForms, we’d have
fields prefixed by :2:, :3:, :4:, :5: as well.

So let’s add 5 more textboxes to our form. Bind them to the


following fields:

:1:Address
:1:StreetAve
:1:StreetType
:1:City
:1:State

When you’re done, proceed to the next step.

100
I T ’ S A S E A S Y A S A - B - C !

Ok, now your screen will likely look similar to this.

What have we basically got?

We’ve got the top two textboxes displaying data from our
tblCities table.

And the other 4 textboxes will display data from our


tblListings table.

By the way, before we proceed, here’s a little tip. Notice


how my textboxes are not aligned very neatly? You can
quickly clean this up by doing the following:

1. Drag a selection box around all of your textboxes as


I’ve done here. Notice the blue line that indicates
your selection?

101
I T ’ S A S E A S Y A S A - B - C !

2. Once you’ve selected all your textboxes they should


appear like this. If you wish, you could drag any
one of them, and you will find that they all move.
But we’re going to do something different for now.
Go to the next step …

3. Click the FILE/Align controls/Rights menu and see


what happens in the next step…

102
I T ’ S A S E A S Y A S A - B - C !

4. VOILA!!! All your textboxes are now neatly


aligned based on the ‘right-most’ position of your
selected controls!

5. As you can see here, I’ve also done the same with
my labels.

Another way of doing something similar is to choose the


‘FILE/GRID/Snap to grid’ menu option. When this is
selected, your controls will jump to the nearest grid line
when you move them. This too allows you to position your
form controls very neatly.

Anyway, let’s save our form, and try running it …

HOORAY! It works!

But it sure isn’t very useful though is it?

Notice that when you move from record-to-record using the


menu bar, you end up scrolling through the tblCities data.
The textboxes that are bound to the tblListings table do not
change.

Why?

Because the menu-bar controls ONLY affect the form’s


MAIN datasource. They do not affect any of the other 5
subforms.

Let’s edit our form again, and we’ll make it possible to


‘browse’ the listings as well.

Proceed to next step.

103
I T ’ S A S E A S Y A S A - B - C !

Let’s add two buttons to our form, as well as a textbox.


Give the textbox a TAGNAME value of RECORDNO.

Add the following code in the ONCLICK events of each:

PREVIOUS BUTTON
MOVEPREV(1)
SETVALUE(~RECORDNO~//POSITION(1))

NEXT BUTTON
MOVENEXT(1)
SETVALUE(~RECORDNO~//POSITION(1))

Can you guess what these two commands do? They move
backward and forward through SubForm#1 which in this
case is our tblListings table, and at the same time, they
display the current position in the textbox!

Let’s save the form, and test it out…

Cool!

It works!

Now we can traverse either our tblCities OR our tblListings


tables. Are you starting to imagine all the possibilities?

By now this should be enough to get you started with your


own powerful ‘subforms’.

But perhaps we can add one more layer of complexity to


this simple example that will further demonstrate what
subforms can do.

As it stands, this application really isn’t too useful.


Wouldn’t it be neat though if we could scroll through the
tblCIties and then have only those records from tblListings
that are found in the currently displayed city.

Well, this is very possible. Move to the next step, and you’ll
see how.

104
I T ’ S A S E A S Y A S A - B - C !

Actually, all we need to do to implement this change is to


add TWO lines of code! That’s IT!

So, edit your form again, and open your FORM properties.

Then, in the ONCURRENT event, add the following two


lines of code:
SUBFORMREFRESH(1//"SELECT * FROM tblListings WHERE city =
'"~city~"'")

SETVALUE(~RECORDNO~//POSITION(1))

When you’re done, save your changes, and try running the
form again.

EXCELLENT!

We can now move through the tblCities table, and view


ALL the related records from our tblListings.

There’s no doubt about it … subforms are a VERY


powerful tool.

105
I T ’ S A S E A S Y A S A - B - C !

6
Chapter

Chapter 6 – Using abcDB


‘Wireless’ Database
NOTE: Currently, abcDB ‘Wireless’ is still only available in version 5.0. Therefore,
some of the screens in this chapter will appear different than the rest of this manual.

With the introduction of abcDB ‘Wireless’ in late 2001, mobile users around the world have
been able to access their important data ‘remotely’ from virtually anywhere in the world that
they have access to the internet.

Of course, abcDB ‘Wireless’ can also be used successfully in wi-lan (wireless LANS) situations
as well. As long as your device has an IP connection to the abcDB ‘Server’, your data is as
close as your PocketPC!

This chapter will introduce you to some of the basics of using abcDB ‘Wireless’ such as
adding remote servers, linking to remote tables, and more. So let’s get started …

6.1 Adding a New Remote Connection

106
I T ’ S A S E A S Y A S A - B - C !

Notice that abcDB ‘Wireless’ contains


one extra TAB called Remote.

This is where you create ‘connections’


to your various abcDB ‘Servers’.

For the purpose of this tutorial, let’s


assume that you and I are the
Presidents of a global corporation
called ‘ABC Corporation’. What we
want to design is an application that
will allow us to access our company’s
enterprise database while we’re on the
road. We’re also going to assume that
we’ve installed the abcDB Server on a
computer in our head-office (See
Appendix G for details), that the IP
address for this computer is
192.168.1.3, and that we’ve configured
the server to ‘listen’ on port# 9005.

Let’s tap the NEW button on the


REMOTE tab, and move to the next
step.

As you can see, I’ve already entered


the required data.

Since our head-office is located in New


York, that’s the descriptive name I’ve
given this connection.

The other settings I’ve entered are:

Server: 192.168.1.3
Note: We could just as easily have entered a
domain name. For example, you could enter
www.YourName.com if this URL points to the
correct IP address.

Port: 9005

UserID: guest

Password: guest

The HTTP Cloak option is specifically

107
I T ’ S A S E A S Y A S A - B - C !

for servers that are behind a firewall.


In this case, we’re not worried about a
firewall, so we’ll leave it unchecked.

Once all the necessary data is entered,


let’s tap the TEST button to see if we
can successfully connect to our remote
server:...

And it worked!

Let’s move to the next step, and we’ll


take a quick look at what happened
on our ‘server’ back in New York…

Here on the SERVER application, we


can see the details of all requests
received from remote abcDB ‘Clients’.

In this screen, we can see that a


request was received from IP address
192.168.1.88, which of course was my
PocketPC. The command issued was
the LOGIN command.

We’ll be returning to this screen later,


but for now, let’s go back to our
PocketPC…

108
I T ’ S A S E A S Y A S A - B - C !

Now that we know our remote


connection is configured properly, let’s
tap the ADD THIS REMOTE SERVER
button.

We’ll then see our newly added


‘remote server’ in the list as shown
here.

Now that we’ve completed this step,


the next thing we’ll do is ‘link’ abcDB
to one of the tables contained in our
remote database.

Move to the TABLES tab, tap the NEW


button, and proceed to the next step…

6.2 Adding a Remote


Linked Table
Whenever you create a new table in
abcDB ‘Wireless’, you’re given three
options.

1. Build a LOCAL table.

2. Create a LINK to a remote table

3. Import data from a remote table

We’re going to LINK to a remote table,


so select it and tap the OK button to
continue …

109
I T ’ S A S E A S Y A S A - B - C !

Now, as you can see, we are shown a


list of all our Remote Servers (in this
case, we only have New York)

Let’s choose it, and then tap the GET


TABLE LIST button to see what tables
exist on our computer back in New
York.

Move to next step …

And as you can see, there are 4 tables


in our database back in New York.
They are:

- Customers
- Inventory
- Receivables
- Vendors

We are particularly interested finding


out how many customers owe us more
than $50,000, so we’re going to create
a LINK to our customers tables.

Let’s choose the ‘customers’ table from


the list, and then move to the next step

110
I T ’ S A S E A S Y A S A - B - C !

As soon as we select a table from the


list, abcDB will request the server to
return all the FIELDS that are contained
in that table.

Here we can see the list of fields in our


‘customers’ table.

The purpose of the ‘Unique Field’ is so


that we can tell abcDB which field is
our PRIMARY KEY field (see Appendix
F for details about Primary Key fields).
This is VITAL if we wish to be able to
edit the data in our table.

Let’s choose the ID field from the list,


since it is the PrimaryKey field in the
customers table.

Then tap the CREATE LINK TO


SELECTED TABLE button, and move to
the next step …

We now need to enter a name for our


‘linked table’.

Let’s call it Customers.

Tap OK to create the link, and then


tap EXIT to return to the abcDB main
menu.

111
I T ’ S A S E A S Y A S A - B - C !

Cool! There is our new ‘linked table’.

We can now use it just like we would


any other table, for example, we can
tap OPEN to view the contents of this
table.

IMPORTANT: Opening a remote table


in this matter is NOT
RECOMMENDED. Why? Because it
will return ALL the records that table
contains. You can imagine how long
this would take if our table contained
thousands (or millions?) of records. It
is always important to limit the records
retrieved by using queries, which we’ll
demonstrate in a moment.

In this case, we know that our


Customers table only contains 20
records, so we’ll go ahead and open it,
mindful of the fact that this is not
usually recommended.

And here we can see the 20 records


that are contained in our Customers
database back in New York.

Remember, we could be accessing this


data from virtually ANYWHERE in the
world! As long as we have an IP
connection to the computer in New
York.

Now suppose we only want to view


the customers whose account balance
exceeds their credit limit. How can we
do this?

By creating a query! Let’s move to the


QUERIES tab, tap NEW, and then
move to the next step.

112
I T ’ S A S E A S Y A S A - B - C !

6.3 Adding a Remote


Query
We’re now given the option to create a
query based on a table in our local
database OR on a table in any of our
remote servers.

Let’s choose NEW YORK and tap


OK….

Here at our query builder, we have the


ability of choosing tables we’ve already
created links to. Here we can see our
Customers table.

NOTE: Even if we had not created a


‘linked table’ to our remote ‘Customers’
table, we could still execute a query by
simply entering the valid SQL here.

So let’s design our query. Move to the


next step…

113
I T ’ S A S E A S Y A S A - B - C !

The query displayed here will return


the LASTNAME, BALANCE,
CREDITLIMIT and ID for every
customer whose balance exceeds his
credit limit. It is very important to
include the PRIMARYKEY field of the
remote table, which in this case is the
ID field.

Let’s SAVE this query and call it


OverCredit.

Move to next step ..

If we wish to be able to EDIT the data


returned from a remote query, we
need to enter the name of the remote
table being queried.

In this case, our remote table is named


CUSTOMERS on the server.

Tap OK and move to next step …

114
I T ’ S A S E A S Y A S A - B - C !

In addition to the TABLE name, we


also need to inform abcDB of the
PrimaryKey field of our remote table.
You must ensure that this field is
included in your query results,
otherwise you will receive an error
when executing this query.

The unique PRIMARYKEY index of our


customers table happens to be the ID
field, so we’ll enter than and click OK
to continue…

And there is our remote query!

Let’s open it to see if it works.

115
I T ’ S A S E A S Y A S A - B - C !

It worked!

This tutorial has hopefully given you


the basic skills required to being
accessing your data remotely.

As with anything new, the best way to


become proficient with this is to play
around with it yourself.

116
I T ’ S A S E A S Y A S A - B - C !

7
Chapter

Chapter 7 – Printing with abcDB


(Printing enabled versions only)

With the introduction of abcDB ‘Printing’ versions in April of 2002, abcDB users around the
world now have the ability to PRINT their important data and forms directly from their
PocketPC’s!

This chapter will show you what can be accomplished, and is going to be using the abcDB
REALTOR application that we constructed in Chapter 5, to demonstrate this.

7.1 Printer tutorial


First of all, we have OPENED the tblListings table as you
can see here.

From the FILE menu, we’ll choose PRINT…

Move to next step ..

117
I T ’ S A S E A S Y A S A - B - C !

We’re going to print ALL the records (25 in total), so


we’ve checked the appropriate option.

Tap OK and move to next step …

Now we need to enter the appropriate printer


information.

In this case, I’m using an HP compatible color printer


with an Infrared port, so I’m going to simply tap the
START PRINTING button.

Move to next step …

118
I T ’ S A S E A S Y A S A - B - C !

abcDB will now attempt to connect to the printer using


the connection we chose in the previous step (ie. The
Infrared port)

To see what the printout looks like, move to the next


step…

Since all of the columns in this table couldn’t fit on one page, abcDB has automatically printed
the remaining columns on the 2nd page.

PAGE#1

PAGE#2

119
I T ’ S A S E A S Y A S A - B - C !

Now, let’s see what happens when we print a


form. Here’s the frmListings form that we
created in chapter 5.

Let’s print it by selecting the TOOLS/PRINT


menu.

To see an actual copy of the printout, move


to the next step.

NOTE: If an image control has been loaded


using the IMAGE(LOAD) command, it will not
print. Images will only print when they are
filled with images obtained using either the
PATH IN FIELD or FIXED PATH property.

NOTE: The background color of a form will


not print.

Here we are! As you can see, printing is basically a WYSIWYG (What you see is what you get)
format.
Let’s take a look now at how we can print BARCODE Labels …

120
I T ’ S A S E A S Y A S A - B - C !

To demonstrate barcode printing, I’ve created a


quick form based on an Inventory table.

I’ve added 8 textboxes, each of which are bound to


the ITEM code field.

Then, I’ve set each textbox to print a different


barcode type. This is done by editing the textbox,
and changing the BARCODE property to the
required type.

Move to next step to see this being done …

121
I T ’ S A S E A S Y A S A - B - C !

As you can see, we have all the major barcode types


available. When you set this property for a textbox,
it only becomes evident when PRINTING. When
‘viewing’ a form on your device, the textbox will
only contain the actual text data from the field.

In any case, I’ve set each textbox to print a different


barcode.

Let’s move to the next step, and we’ll see what this
form looks like when we run it on the device.

So here we are viewing ITEM# 1234567.

As we mentioned in the previous step, all the


textboxes look the same when we’re ‘viewing’ the
form. But let’s PRINT this form, and we’ll see what
the output looks like in the next step…

122
I T ’ S A S E A S Y A S A - B - C !

As you can see, the ability to print data opens a whole new world of possibilities.

We hope that this tutorial has helped you become acquainted with this powerful feature

7.2 Printer Settings


What Do the Different Printer Options Do?
When preparing to print, you can set a different printer options. You will see the "Select Printer" screen
(below left) and can tap the "More Settings" button to view and change additional options (below right).
Below is a description of each option.

123
I T ’ S A S E A S Y A S A - B - C !

Select Printer Options:

Printer: Select the printer to print to. Some printer selections work for a variety of printers, such as the
"HP PCL" selection which prints to most Hewlett Packard DeskJet, LaserJet and compatible printers.
Port: Select between Infrared, Bluetooth, Network printing (Pocket PC 2002 only) and Serial (COM1-
COM8). Most Windows CE devices only have Infrared and COM1 and need special attachments to
use the other selections. USB printing and printing across an ActiveSync connection to a desktop
printer is not supported.

NOTE: On most Pocket PC and Palm-sized PC devices, you CANNOT use the serial and infrared
ports at the same time. This means that if your device is connected to your desktop PC using the serial
Sync cable, the Infrared port will not work. You must disconnect the serial connection to use Infrared
printing.
Color/Mono: Select Monochrome (Black & White) if your printer is not a color printer (or if you wish to
print in mono). If your printer has color capabilities AND has a black ink capability, select "4-Color
CMYK". If your printer cannot hold both color ink and black ink at the same time, select "3-Color CMY".
Paper Size: Select paper size for use. You can choose "Custom" and then set special paper sizes in
the "Custom Paper" Width and Height boxes. For printers that use "roll" paper, you can set a maximum
paper height of 22 inches.
More Settings Options:
Margins: Set Left, Right, Top and Bottom margins of the printed page.
Form Feed Settings: For most printers, this should be left at "Normal Form Feed" so that after a page
is printed, the page is properly ejected from the printer and the next page can be printed. Some
printers use "roll paper". For these you may wish to use the "Paper Height" setting to print pages the
height selected by Paper Size setting (including Custom Paper Height). Or you can use the "Scroll"
setting which will print each page and then "scroll" or roll the paper the distance past the last printed
portion of your document. This is great for printing receipts or quick notes where you need a "tear-off"
strip after your printed output but you don't need to roll out blank paper to fit the full height of the paper
setting.
Draft Mode: (Default: Not Checked) Many printers offer more than one printing "resolution" (the
number of dots that can be printed to make up a document). The Draft Mode selection uses a lower
resolution than normal (if available). The result is faster printing but with lower quality. Note that many
printers do not offer a draft mode and standard mode will be used.

124
I T ’ S A S E A S Y A S A - B - C !

Dither Images: (Default: Not Checked) Color images have to be converted to a format that can is
suitable for printing, either for color or black and white printing. The best general method for doing this
conversion is used, but this can occasionally result in poor image quality for certain images. This
"Dither" selection offers an alternative conversion method that may be useful at times.
Single Thread: (Default: Not Checked) Using multiple threads offers a way to reduce printing times
and improve responsiveness to user commands during printing. However, under certain
circumstances, checking Single Thread can improve reliability. This item should generally be left off.
Alternate IR Connection: (Default: Not Checked) This provides a slightly different software approach
to try to connect to Infrared printers. If the default method does not work, try checking this and see if it
helps.
Data Compression: (Default: Checked) Many printers can work with data that is sent to it in special
compressed forms to reduce the amount of data and time needed to send the page from the Windows
CE device to the printer (which is the slowest part of printing). Checking "Compressed Printing" can cut
printing times significantly on some printers. However some older printers may not support
compressed printing.
IR Buffer Adjustment: (Default: Not Checked) If printing is exceedingly slow using a Canon BJC
printer OR if you have trouble with infrared printing "hanging" your device, check this item and try
again.
Print Density: Default: Normal) Allows you to adjust output to be darker or lighter. For example, some
thermal printers print out text very light, so you could adjust Print Density to "Darker" for improved
readability.
Serial Port Speed: Used only by Serial (COM1- COM8) ports to select serial port speed. You need to
make sure that this setting matches the speed setting of your serial printer. NOTE: for using serial
printers, you may need a "Null Modem" connector to properly connect your Windows CE "Sync" serial
cable to your serial printer. The Input and Output pins on the WinCE cradle are reversed from standard
Windows PC serial connections. A "Null Modem" connector swaps these back.
Serial Handshake: (Default: Software) Affects Serial ports (COM1-COM8) only... adjusts "handshake"
communication protocol for serial printing. The "Software" setting (XON/XOFF) works for the majority
of serial printers. The "Hardware" setting uses CTS/RTS.
Settings to get the best printing results - from the "Select Printer" screen, tap "More Settings"
button then check the following settings:

Data Compression should be ON (checkmark visible).

IR Buffer Adjustment should be OFF (NO checkmark)

Draft Mode - default setting is OFF (NO checkmark). This produces the best quality printing. Checking
"Draft Mode" (ON) will produce somewhat lower quality printing but can speed up printing times
significantly.

Print Density can affect printing speed somewhat - the darker the setting, the slower the printing (but
only slightly).

7.3 Network Printing (PocketPC 2002 ONLY)


abcDB Printing versions support network printing on Pocket PC 2002 devices as well has H/PC 2000 and
H/PC Pro devices. On original Pocket PC 2000 devices, no network printing options are available.

Before using network printing, you must have your Pocket PC 2002 or Windows CE device working
properly with a network card and connection. If you are trying to print to a shared printer attached to a
networked PC, you should be able to use File Explorer on your device to find the networked PC. If File

125
I T ’ S A S E A S Y A S A - B - C !

Explorer cannot find the networked PC, then our printing solutions will be unable to find a shared printer
on that networked PC.

For general networking connection questions and technical support, contact the manufacturer of your
network card.

You can print to two types of network printers (see below for detailed instructions for printing to both
types):

1. "Network PC with Shared Printer" - A printer that is attached to a desktop PC, where the
desktop PC is networked and the printer is "shared" to the network.

2. "Network IP Printer" - A printer that is directly connected to the network and has its own IP
address (it does NOT rely on being connected to a Host Computer).

Network PC with Shared Printer:


You can print to a printer that is connected to a networked "host" desktop PC as long as the printer is shared to
the network. You will need the networked computer name (contact network administrator for this help and
information).

On your device, at the "Select Printer" screen, select the desired printer type and tap on the Port list (below left).
Select "Network: PC with shared printer" (below right).

Initially, you will not have any network printer paths set up. Tap "Add" button (below left). Enter the
Network Computer name (below right).

126
I T ’ S A S E A S Y A S A - B - C !

Tap the "Search for Printers on Host Computer" button to look for shared printers on the specified Host
Computer. Any printers found will be listed (below left) and can be selected for printing. Tap OK and see
network printer path (below right). Tap Save.

Note: If the "Search" process responds with an "Unable to connect to computer or find network printers"
error message, double check that you have entered the correct Network Computer name. You should
also go to the File Explorer and make sure you are able to access the networked computer from File
Explorer.

You should now see the correct printer path (below left). Tap OK and you will see the Select Printer
screen with the networked printer path showing in the "Set Net Path" button (below right). Tap "Start
Printing" to begin network printing.

127
I T ’ S A S E A S Y A S A - B - C !

Network IP Printer:
A "Network IP Printer" is a printer that is directly connected to the network and has its own IP address (it does
NOT rely on being connected to a Host Computer). To print to a Network IP printer, at the "Select Printer"
screen, select the correct Printer type and select the "Network: IP Printer" list item (below left). Tap the "Set IP
Printer Addr" button to enter the printer's IP address (below right) and Port number (if different from the default
9100), tap "Save" button. You can then tap "Start Printing" to begin printing to the IP printer.

128
I T ’ S A S E A S Y A S A - B - C !

A
Appendix

Appendix A -- abcDB™ Field Types


Field Type Description
Text Variable length character string. Length must be between 1 and 255
inclusive.

ID Increment Integer field that abcDB™ will automatically populate with the next highest
ID number.

* Note: When adding new records in a FORM, the ID Increment field


MUST be populated by using the NEXTID() function in code (ie. For
example, this could be executed in the ON-ADD event of the form)

ID Random Integer field that abcDB™ will automatically populate with a random ID
number

* Note: When adding new records in a FORM, the ID Increment field


MUST be populated by using the RNDID() function in code (ie. For
example, this could be executed in the ON-ADD event of the form)

ID GUID Text field (at least 50 wide) that abcDB™ will automatically populate with
a GUID (Globally Unique Identifier)

* Note: When adding new records in a FORM, the ID Increment field


MUST be populated by using the AUTOID() function in code (ie. For
example, this could be executed in the ON-ADD event of the form)

Memo Character string containing up to 32,000 characters.

Integer 4 byte signed integer

Date/Time

Boolean Logical or Boolean value. Zero is FALSE and nonzero is TRUE.

129
I T ’ S A S E A S Y A S A - B - C !

Double Double-precision floating point value.

Ole Binary value of less than 65,469 bytes.

VarBinary Binary value of less than 256.

SmallInt 2-byte signed integer.

130
I T ’ S A S E A S Y A S A - B - C !

B
Appendix

Appendix B -- SQL Reference

B.1 SELECT – Join


This statement combines two tables using a field common to both tables. ADOCE uses a subset
of the fields in the combined database to build a recordset.
SELECT [tablename.]fieldname [,[tablename.]fieldname ...] FROM tablename
INNER JOIN tablename2 ON tablename.fieldname = tablename2.fieldname2
PARAMETERS

fieldname
The name of a field in the table to include in the recordset.
tablename
The name of the table from which to retrieve data.
RETURN VALUES

None.
REMARKS

Because the tables being combined may have fields with the same name, it may be necessary to
specify the table name in addition to the field name using the dot convention. For example, if
more than one table has the ProductID field, the table name is not optional and you must specify
tablename.ProductID as the field name, where tablename is the name of a table that contains a
field named ProductID.

You can use an INNER JOIN operation in any FROM clause. This is the only join operation
supported in ADOCE. INNER JOIN combines records from two tables whenever there are
matching values in a field common to both tables.

If you try to join fields containing Memo or OLE Object data, an error occurs.
You can join a maximum of four tables, and only inner joins on equality are supported. Joins are
possible only with the above explicit INNER JOIN syntax. Implied joins using the WHERE
clause are not supported.
At least one of the tables in each join clause must be indexed on the joined field.

131
I T ’ S A S E A S Y A S A - B - C !

A recordset returned by a JOIN statement with one or more columns from a single table can be
updated. If a returned column has data from more than one table, it is read-only and cannot be
updated.
INNER JOIN clauses can be nested to create complex queries. Brackets must be used to enclose
table names that contain spaces.
EXAMPLES

The following SQL statement shows how you could join the Categories and Products tables on
the CategoryID field.
SELECT CategoryName, ProductName
FROM Categories INNER JOIN Products
ON Categories.CategoryID = Products.CategoryID;
In the preceding example, CategoryID is the joined field, but it is not included in the query
output because it is not included in the SELECT statement. To include the joined field, include
the field name in the SELECT statement. In this case, the field name is Categories.CategoryID.
You must specify the table name when a field name is used in more than one table.
The following SQL statement shows a complex query using INNER JOIN.
SELECT Orders.ShippedDate, Shippers.CompanyName, Orders.ShipName,
Products.ProductName, [Order Details].UnitPrice,
[Order Details].Quantity, [Order Details].Discount
FROM Shippers INNER JOIN
(Products INNER JOIN
(Orders INNER JOIN [Order Details] ON
Orders.OrderID = [Order Details].OrderID) ON
Products.ProductID = [Order Details].ProductID) ON
Shippers.ShipperID = Orders.ShipVia
WHERE (((Orders.ShippedDate) >= #5/1/99# And
(Orders.ShippedDate) <= #5/31/99#))
ORDER BY Orders.ShippedDate

B.2 SELECT – Like


This statement searches for and returns all fields that contain a pattern similar to the pattern
specified.

match_expression [NOT] LIKE pattern


PARAMETERS

match_expression
The SQL expression to compare with the pattern. This expression must be of string data type.
pattern
The pattern to search for in the match_expression parameter and can contain the percent character (%) as a wildcard.
escape_character
The character string to use as an escape character. There is no default character for escape_character and it must contain
only one character.
RETURN VALUES

NONE. REMARKS

132
I T ’ S A S E A S Y A S A - B - C !

The wildcard character (%) can be used to search for a string using one of three patterns:
Type of search Wildcard pattern
String begins with type LIKE 'type%'
String contains type LIKE '%type%'
String ends with type LIKE '%type'

Prior to version 2.12, ADOCE did not allow for a query of the percent character (%) at the
beginning or end of a string.

Constructing a statement with the wildcard character embedded in the statement, for example
sam%le, results in the string being matched literally.

B.3 SELECT – Order By


This statement sorts the selected rows by the fields specified.
SELECT * FROM tablename ORDER BY fieldname [ASC | DESC]
PARAMETERS

fieldname
The name of the field used to sort the rows.
RETURN VALUES

REMARKS

If fieldname is an indexed field, then the table is opened with the sort properties for index active.
ADOCE does not support sorting on binary fields. You can sort up to four fields.

When fieldname has no associated index, sorting is done in memory on the data and an ordered
recordset is returned.
The optional sort clause determines the order to items will be sorted. ASC tag sorts the data in
ascending order, while DESC sorts it in descending order. DESC is the default sort order.

B.4 SELECT – Projection


This statement uses a subset of the fields in the database to build a recordset.
SELECT [tablename.]fieldname [,[tablename.]fieldname ...] FROM tablename
PARAMETERS

fieldname
The name of a field in a table to include in the recordset.
tablename
The name of a table from which to retrieve data.
RETURN VALUES

None.
REMARKS

133
I T ’ S A S E A S Y A S A - B - C !

Use this statement to build result sets that contain only the fields you want. Field names can be
repeated or omitted. There are performance benefits to excluding field names. This is especially
true if only a few columns are needed from a table with a large number of fields or if one of the
unnecessary fields contains a large amount of data, such as a Long string or varbinary data.

Field references must be separated by commas.

B.5 SELECT – Restricted


This statement restricts the data returned by comparing the data in the table against the
conditions specified in the WHERE clause.
SELECT * FROM tablename WHERE fieldname-expression [AND|OR fieldname-
expression]
PARAMETERS

tablename
The name of the table from which to retrieve data.
fieldname-expression
Can take one of the following forms:

• [NOT] fieldname operator constant

• fieldname IS [NOT] NULL

• fieldname IS [NOT] TRUE

• fieldname IS [NOT] FALSE

• fieldname [NOT] LIKE “string%”

Value Description
fieldname The name of a field in the table to use in a comparison operation.
operator The type of operation performed. Can be one of the following values:
Operator Description
= Equal*
> Greater than
>= Greater than or equal
< Less than
<= Less than or equal
<> Not equal*
constant A numeric string or date, enclosed by quotation marks.
string% A string constant followed by the percent (%) or asterisk (*) wildcard character. A wildcard
character can also be used by itself to match everything. Use a wildcard character only at the end
of the string constant.

*. This operator produces an error when used with floating-point data types.
RETURN VALUES

REMARKS

134
I T ’ S A S E A S Y A S A - B - C !

An error results if an SQL statement uses the equal operator (=) or the not equal (<>) operator
to compare floating-point data types.

You can use parentheses to group expressions and establish precedence.


The following additional rules apply to the WHERE statement:
• When used, no type conversion is done.

• BETWEEN is not supported.

• IN is not supported.

• LIKE only works against varchar data types.

• WHERE clauses against unsigned data are not supported.

• The varbinary data types are supported only with the IS [NOT] NULL operator.

• Floating point comparisons are approximate. Testing for equality against floating point values is not supported and returns
an invalid field comparison error.
EXAMPLES

B.6 SELECT – Simple


This statement returns all the fields and all the rows from the specified table.
SELECT * FROM tablename
PARAMETERS

tablename
The name of the table from which to retrieve data.
RETURN VALUES

One of the following error messages can be returned:


• E_OUTOFMEMORY

• DB_E_ERRORSINCOMMAND

• DB_E_NOTABLE
REMARKS

When invoked by the Open method, this statement returns the same recordset that tablename
would. In other words, it causes a table to be opened with all fields and all rows available.

B.7 ALTER TABLE


This statement supports several different commands to change the structure of a table, including
adding, deleting, moving, and renaming fields.

135
I T ’ S A S E A S Y A S A - B - C !

ALTER TABLE tablename TO tablename2


ALTER TABLE tablename ADD fieldname fieldtype [BEFORE fieldname2]
ALTER TABLE tablename DROP fieldname
ALTER TABLE tablename MOVE fieldname [BEFORE fieldname2]
ALTER TABLE tablename RENAME fieldname TO fieldname2
PARAMETERS

tablename
The name of the table in which to make structural changes.
tablename2
A new name for an existing table. A table with the same name cannot already exist.
fieldname
The name of the column in the table to add, remove, or rename. In order to add a column, it cannot already exist.
fieldname2
The name of another column in the table. For the ADD and MOVE statements, the name must exist in the table. For the
RENAME statement, the name cannot already exist.
fieldtype
The data type for the column. For more information about data types, see CREATE TABLE.
RETURN VALUES

None.
REMARKS

The ALTER TABLE statement renames a table, adds a column, moves a column, renames a
column, or deletes a field from a table.
A table must contain at least one field. Attempting to drop the last field in a table results in an
error that returns the constant adErrIllegalOperation.
Tables cannot have duplicate field names.
An SQL statement cannot be longer than 2,048 characters. A longer statement causes an error.

B.8 CREATE INDEX


This statement creates an index for a field.
CREATE INDEX indexname ON tablename (fieldname [DESC] [CASESENSITIVE]
[UNKNOWNFIRST])
PARAMETERS

indexname
The name of a new index.
tablename
The name of the table for which to create the index.
fieldname
The name of the field for which to create the index. Only one field is indexed at a time, and only one index is created per
field. The index can be given additional properties by specifying an index attribute after the field name.
RETURN VALUES

• E_OUTOFMEMORY

• DB_E_ERRORSINCOMMAND

• DB_E_DUPLICATEINDEXID

• DB_E_BADCOLUMNID

136
I T ’ S A S E A S Y A S A - B - C !

• DB_E_NOTABLE
REMARKS

The CREATE INDEX statement can increase the efficiency of SQL queries that use SELECT
ORDER BY and SELECT WHERE statements.
The following table shows the possible index attributes. They are used singly or in combination.
Attribute Description
DESC Sorts the data in descending order. The default is ascending.
CASESENSITIVE Sorts capital letters before lower case. The default is case insensitive.
UNKNOWNFIRST Sorts NULL to the start of the table. The default is NULL at the end of the table.

The CASESENSITIVE and UNKNOWNFIRST statements work on Windows® CE-based


tables only and generally are not supported on other database systems.

An SQL statement cannot be longer than 2,048 characters. A longer statement causes an error.

B.9 DROP DATABASE


This statement deletes a database from a Windows® CE-based device.
DROP DATABASE 'database_name.cdb' [,…n]
PARAMETERS

database_name
The name of the database to be removed. This name must be in single and have the database file (.cdb) extension.
n
Additional databases to be dropped in a comma-separated list.
RETURN VALUES

None.
REMARKS

Dropping a database deletes a database from a device and destroys all data it contains. It is an
irreversible process, so use this statement with care.
Use a comma-separated list to drop multiple databases.
An SQL statement cannot be longer than 2,048 characters. A longer statement causes an error.

This statement is available on the following platforms: Microsoft® Windows® CE, Handheld
PC Professional Edition, Version 3.0, Microsoft® Windows® CE for the Palm-size PC, and
Microsoft® Platform Builder version 2.12.

B.10 DROP TABLE


This statement deletes a table from a Windows® CE–based device.

137
I T ’ S A S E A S Y A S A - B - C !

DROP TABLE tablename


PARAMETERS

tablename
The name of the table to delete.
RETURN VALUES

One of the following error values can be returned:


• E_OUTOFMEMORY

• DB_E_ERRORSINCOMMAND

• DB_E_NOTABLE
REMARKS

Dropping a table deletes a database table from a device and destroys all data it contains. It is an
irreversible process, so use this statement with care.
An SQL statement cannot be no longer than 2,048 characters. A longer statement causes an error.

B.11 DROP INDEX


This statement deletes an index from a field.
DROP INDEX tablename,indexname
PARAMETERS

tablename
The name of the table from which to remove the index.
indexname
The name of the index to remove from the table.
RETURN VALUES

One of the following error values can be returned:


• E_OUTOFMEMORY

• DB_E_ERRORSINCOMMAND

• DB_E_NOINDEX

• DB_E_NOTABLE
REMARKS

Fields can have only one index. Delete the existing index for a field before creating a new one.
An SQL statement cannot be longer than 2,048 characters. A longer statement causes an error.

138
I T ’ S A S E A S Y A S A - B - C !

C
Appendix

Appendix C -- abcDB™ ‘Script’


Commands
This appendix contains all the abcDB™ ‘script’ commands that
are available.

Command Description

ADDEVENT
This statement will allow you to add or modify the code which will be executed
then the specified controls event is fired.
ADDEVENT(tagname// event Name//event Code)

PARAMETERS

tag
The TAG value of one of the controls on your form.
Event Name
The name of the ‘event’ you wish to modify
IMAGE ONCLICK
TAB ONCLICK
TEXTBOX ONCLICK
GOTFOCUS
LOSTFOCUS
KEYPRESS
COMBOBOX ONCLICK
KEYPRESS
GRID AFTERUPDATE
ONADD
ONCURRENT
ONDELETE
CHECKBOX LOSTFOCUS
LABEL ONCLICK
BUTTON ONCLICK
DATEPICKER LOSTFOCUS
TREEVIEW ONCLICK

Event Code
The cod e you wish to execute.

Example:
To run the subroutine VERIFY whenever the textbox with tagname ‘text1’ is typed in:

139
I T ’ S A S E A S Y A S A - B - C !

ADDEVENT(text1//KEYPRESS//”RUNSUB(VERIFY)”)

CAPTION
This function will allow you to change the caption of either a label or a command
button.

CAPTION(tag // CAPTION)

PARAMETERS

tag
The TAG value of one of the controls on your form.
CAPTION
Enter the text you wish this label or button to display.

Example:
To change the caption of the button with a tag name of btnCancel to SAVE:

CAPTION(btnCancel//”SAVE”)
COLOR
This function will set the background/foreground colors of the control specified.

COLOR(tag // Background Color // Foreground Color)

PARAMETERS

tag
The TAG value of one of the controls on your form. This is the control that the user-selected value will
be stored to
Background Color
The background color*
Foreground Color
The foreground color*

Example:
To change the ‘myText’ textbox to red foreground on black background:
COLOR(~mytext//0//255)

CREATECONTROL
This Statement will add a new control to your form at runtime.
CREATECONTROL(controlType//Tagname//bounds//tabControl
name//tabpage//backCOlor//foreColor//boundField))

PARAMETERS

Control Type
The ‘type’ of control you wish to add
TEXTBOX
CHECKBOX
IMAGE
SCRIBBLE
COMBOBOX
DATAGRID
LABEL
BUTTON
DATEPICKER

140
I T ’ S A S E A S Y A S A - B - C !

TREEVIEW

Tagname
The tagname you wish to assign to this control
Bounds
The location and size in this format: in pixels
(LocationX,LocationY,Width,Height)
Tabcontrol Name
If adding this control to a tabcontrol, enter the tab controls tagname. Otherwise, leave blank
TabPager
The tabpage to add to (0=first tab)
Bound field
The field you wish to bind this control to.

Example:
To create a textbox:
CREATECONTROL(textbox//text1//50,50,100,100////////)
CURSOR
This Statement will show/hide the ‘wait’ cursor, which informs the user that the
device is busy processing instructions.

CURSOR(parameter)
PARAMETERS

Paramenter
0=Default
1=Wait

Example:
To display the wait cursor:

CURSOR(1)
DELETECONTROL
This Statement will delete the specified control.
DELETECONTROL(tagname)

PARAMETERS

Tagnamer
The ‘tag’ of the control you wish to delete.
Example:
To delete a control with tagname DATE1
DELETECONTROL(Date1)
DRAWELLIPSE
This statement will draw an ellipse. Only available from within the forms
ONPAINT event
DRAWELLIPSE(LocationX//LocationY//Width//Height//Border
Color//FillColor)

PARAMETERS

Location X
Location X in pixels
Location Y
Location Y in pixels
Width
Width in pixels
Height
Height in pixels
Border Color

141
I T ’ S A S E A S Y A S A - B - C !

Color using the RGBCOLOR() function


Fill Color
Color using the RGBCOLOR() function

Example:

Place the following code in your form’s ONPAINT event:


DRAWELLIPSE(50//50//100//100//RGBCOLOR(255,0,0)//RGBCOLOR(0,255,0))

DRAWLINE
This statement will draw a line. Only available from within the forms ONPAINT
event
DRAWLINE(X1//Y1//X2//Y2// Color)

PARAMETERS

X1
Location X1 in pixels
Y1
Location Y1 in pixels
X2
Location X2 in pixels
Y2
Location y2 in pixels
Color
Color using the COLOR() function

DRAWRECTANGLE
This statement will draw a rectangle. Only available from within the forms
ONPAINT event
DRAWRECTANGLE(X1//Y1//X2//Y2//Fore Color//Fill Color)

PARAMETERS

X1
Location X1 in pixels
Y1
Location Y1 in pixels
X2
Location X2 in pixels
Y2
Location y2 in pixels
Fore Color
Color using the COLOR() function
Fill Color
Color using the COLOR() function

Example:

Place the following code in your form’s ONPAINT event:


DRAWRECTANGLE(0//0//200//200//RGBCOLOR(255,0,0)//RGBCOLOR(0,255,0))

DRAWTEXT
This statement will draw text. Only available from within the forms ONPAINT
event
DRAWTEXT(STRING//FONT//BRUSH//X//Y)

PARAMETERS

142
I T ’ S A S E A S Y A S A - B - C !

STRING
Text to draw
FONT
Font. Use the NEWFONT() function
BRUSH
Use the BRUSH() function
X
Location X in pixels
Y
Location Y in pixels

Example:

Place the following code in your form’s ONPAINT event:


DRAWTEXT("HELLO"//NEWFONT(TAHOMA,10,1)//BRUSH(255,0,0)//10//10)
DROPREFRESH
The function will refresh the data in one of the dropdown boxes on your current
form.

DROPREFRESH(tag // SQL // Server // Remote Index // Distinct)

PARAMETERS

tag
The TAG value of one of the dropdown controls on your form.
SQL
The sql statement used to populate the dropdown control. A hard coded set of values may also be used
by entering a comma delimited list of values. Always ensure that both the SQL and the Hard-coded list
are surrounded by double quotes
Server
The Server used to query against .. use --- for the local device
Remote Index
The remote index (Only used for remote tables ... otherwise leave blank).
Distinct
1 = Only show distinct values
0 = Show ALL values
NOTE: In order for DISTINCT to work properly, you must ensure that your SQL returns data sorted
ASCENDING.

Example#1:
To fill the dropdown with a field from the table myTable located on your device, you would
enter:

DROPREFRESH(DROPDOWN1 //”SELECT myField FROM myTable”//---//)

Example#2:
To fill the dropdown with a hardcoded list of Months, you would enter:
DROPREFRESH(DROPDOWN1 //"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"//-
--//)

ENABLE
This function will make the control specified either enabled or disabled.

ENABLE(tag // TRUE/FALSE)

PARAMETERS

tag
The TAG value of one of the controls on your form.

143
I T ’ S A S E A S Y A S A - B - C !

TRUE/FALSE
Enter TRUE to make the control visible … enter FALSE to hide the control

Example:
To DISABLE the textbox with a tag name of myText:

ENABLE(mytext//FALSE)
To ENABLE the textbox with a tag name of myText:

ENABLE (mytext//TRUE)

EXECUTE
This function will execute code.

EXECUTE(CODE)

PARAMETERS

CODE
A string containing the code that you wish to execute

Example:

To execute the code contained in the textbox with the tag 'CODE', do this:
EXECUTE(~CODE~)

If the ~CODE~ textbox contains MESSAGE(“HELLO”//”THERE”), upon running


the EXECUTE(~CODE~) command, you will be presented with a messagebox.

EXIT
This statement will cause code execution to stop.
EXIT()

PARAMETERS

NONE

Example:

TEST(<!NAME!>//=//)
MESSAGE(“You MUST Enter a name first … Please try again”//”ERROR”)
EXIT()
ENDTEST()
MESSAGE(“You entered a correct name”//)
EXITAPP
This function will completely exit abcDB.

EXITAPP()

144
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

NONE

Example:

To allow a user to completely exit abcDB, add the following code to the
ONCLICK event of a COMMAND button:

EXITAPP()
EXPORT
The EXPORT statement will export data to either a CSV or an HTML file for use
in other applications.
EXPORT(Subform//FileName//Delimiter//ExportType)

PARAM ETERS

Subform
Value from 0-5 depending on which subform data you wish to export.
0 = Main Form datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5

FileName
The name of the file to export your data to.
Delimiter
The character used to delimit this file (Usually a comma)
ExportType
1 = CSV/TXT file
2 = HTML file

FONT
This function allow you to change the FONT for the specified control.

FONT(tag // FONTNAME // FONTSIZE // FONTBOLD // FONTITALIC //


FONTUNDERLINE)

PARAMETERS

tag
The TAG value of one of the controls on your form.

145
I T ’ S A S E A S Y A S A - B - C !

FONTNAME
Enter the NAME of the font.
ie. Tahoma
Bookdings
Courier New
Frutiger Linotype
FONTSIZE
The size of the font:
ie. 8, 10, 12, 14
FONTBOLD
Boolean value:
TRUE = Bold
FALSE = Not bold
FONTITALIC
TRUE = Italic
FALSE = Not Italic
FONTUNDERLINE
TRUE = Underline
FALSE = No Underline

Example:
To change the ‘myText’ textbox font to SIZE 14 BOLD:
FONT(mytext//”Courier New”//14//TRUE//FALSE//FALSE)

FORMOPEN
This function will open another form.

FORMOPEN(Formname // SQL // Mode // Server // LinkField //


SubLinkField)

PARAMETERS

Formname
The name of the existing abcDB™ form which you wish to open
SQL
The sql statement you wish to use to populate the form. NOTE: If no SQL is entered, the default SQL
statement will be used (ie. The sql statement that is found in the form’s SQL property)
Mode
The data mode that the form will be opened with

0 = Add Data
1 = Edit Data
2 = Read Only

Server
The data server used to send the sql statement to. Unless the server is a 'remote' server used by abcDB™
Wireless, you must enter the default value of ---.
LinkField
The field (or TAG) on the current form that contains the key value used to ensure referential integrity on
this newly opened form.
Sublink Field
The field on formname that will always be populated with the linkfield value in newly added records.

Example:
To open a form named 'AA' populated with all records where field A’s value = ‘APPLE’:

FORMOPEN("aa"//"select * from a where a ='APPLE’"//1//"---"////)


If the current form contained a textbox with a TAG name of FRUIT, you could open the
new form based on that value like this:

FORMOPEN("aa"//"select * from a where a ='” ~FRUIT~ “’"//1//"---"////)


FORMREQUERY
This function will requery the current form.

146
I T ’ S A S E A S Y A S A - B - C !

FORMREQUERY(SQL // Mode // Server)

PARAMETERS

SQL
The SQL Statement to requery form with.
Mode
The data mode that the form will be opened with

0 = Add Data
1 = Edit Data
2 = Read Only
Server
The server used to query against. Note: Use “---“ for local device

Example:
To requery the current form for all records where field 'b' = 0:

FORMREQUERY("SELECT * FROM A WHERE b = 0"//1//"---")


GOTO
This statement causes the code to ‘jump’ to a specified label
GOTO(Routine)

PARAMETERS

Routine
The name of a ‘label’ that appears somewhere in the current code module. Labels consist of names
preceded by colons : on a separate line.

Example:

SETMEM(MEM1//1)
TEST(MEM1//=//2)
GOTO(ERROR)
ENDTEST()
MESSAGE(“Everything is OK”//”OK”
EXIT()

:ERROR
MESSAGE(“ERROR”//”ERROR”)
EXIT()

GPSCLOSE
This statement closes the PORT to your GPS.
GPSCLOSE()

PARAMETERS

NONE

Example:

147
I T ’ S A S E A S Y A S A - B - C !

GPSCLOSE()

GPSINIT
This statement enables you to send up to three initialization strings to your GPS.

GPSINIT(String1 // String2 // String3)

PARAMETERS

String1
String2
String3
These 3 strings are optional depending on your requirements. You may for example require the ability
to only receive GPRMC messages from your GPS.

Example:

To enable your NMEA standard GPS to receive RMC, and GGA messages, you could run
the following:
GPSINIT("$PRWIILOG,RMC,A,T,2,0"// "$PRWIILOG,GGA,A,T,2,0"//)

GPSOPEN
This statement allows you to specify the PORT and the SETTINGS that your GPS
is designed to use.
GPSOPEN(PORT // SETTINGS)

PARAMETERS

Port
The COMM Port that your GPS uses
Settings
This allows you to specify the BAUD, PARITY, DATABIT and STOP BIT settings for your COMM port.

GPSOPEN(“4”//”4800,N,8,1”)

GRIDREFRESH
This function will requery the grid control on the current form.

GRIDREFRESH(SQL // RemoteTable // RemoteUniqueID // Server //


Linkchild // Linkfield Master // Column Widths)

PARAMETERS

SQL
The sql statement used to populate the GRID. If left empty, the settings currently defined will be used
Remote Table
The remote table that this sql is based on
Remote Unqiue ID
The remote field (unique field) that is used for updating data
Server
The server that this sql will be executed against. Use "---" for the local device..
Linkfield Child
The name of a field in your GRID control.
Linkfield Master

148
I T ’ S A S E A S Y A S A - B - C !

The name of a field in the main form.


Column Widths
The column widths in TWIPS. ie. To set the 1st 4 columns enter the following: 1000,2000,1500,4000.

EXAMPLE #1:
Refresh grid with data from the local table 'A':
GRIDREFRESH("SELECT * FROM A"// // //"---"//////)
EXAMPLE#2:
Refresh grid with data from remote table (abcDB™ ‘Wireless’ only)
GRIDREFRESH("SELECT * FROM myTable"//"myTable"//"myField"//"myServer"//////)

IMAGE
This function allows you to ‘load’ a picture into the image control or set the
‘stretch’ property of the image to true or false.

IMAGE(Load or Stretch // Path or TRUE/FALSE)

PARAMETERS

Load or Stretch
Enter either LOAD or STRETCH
Path or TRUE/FALSE
Enter either a valid path to your image file OR enter TRUE or FALSE depending on whether you want the
image stretched or not.

To Load the image file specified

IMAGE(LOAD//"/My Documents/MyPic.BMP")

To make the image ‘stretch to fit the control:


IMAGE(STRETCH//TRUE) 'Makes the image 'stretch' to fit the control
IMAGE(STRETCH//FALSE) 'Image will not stretch

IMPORT
The IMPORT statement will import data from a text file.
IMPORT(tableName//FileName//Delimiter//Header)

PARAM ETERS

TableName
The name of the table that you’d like the data placed in.
FileName
The name of the file to import your data from.

Delimiter
The character used to delimit this file (Usually a comma)
Header
TRUE = The first row of data contains field names

149
I T ’ S A S E A S Y A S A - B - C !

FALSE= The first row of data does not contain field names

Example #1.
IMPORT(“newTable”//”\My Documents\MyText.txt”//”,”//”TRUE”)
LISTVIEW
This function will display the current table data in LIST form.

LISTVIEW()

PARAMETERS

NONE

LISTVIEW()

MENUADD
This statement will add a menu to the specified menu.
MENUADD(BaseMenu//Text//Name//Code)

PARAMETERS

BaseMenu
The base menuitem to add this new menu to.
Text
The text to display on this menu item.
Name
The ‘unique’ name to assign this menu
Code
The code to run when this menu is clicked

Example #1.

The following line of code will first create a base menu called MAINMENU and will then add a
new menu item which will run the subroutine OPENFORM whenever it is clicked. The
OPENFORM subroutine will be in one of the 5 modules found in your form properties.

MENUBASEADD(“Main Menu”//MainMenu//)

MENUADD(MainMenu//”Accounts Receivable”//AR//”RUNSUB(openform)”)

MENUBASEADD
This statement will add a base menu to the current form.
MENUBASEADD(Text//Name//Code)

PARAMETERS

Text
The text to display on this menu item.
Name
The ‘unique’ name to assign this menu
Code
The code to run when this menu is clicked

150
I T ’ S A S E A S Y A S A - B - C !

Example #1.

The following line of code will add a base menu which will run the subroutine CLOSE whenever
it is clicked. The CLOSE subroutine will be in one of the 5 modules found in your form
properties.

MENUBASEADD(“Close”//Close//”RUNSUB(close)”)

MENUCLEAR
This function will clear all menus from the current form.
MENUCLEAR()

PARAMETERS

None

Example #1.
MENUCLEAR()

MENUDELETE
This statement will remove the specified menu.
MENUDELETE(MenuName)

PARAMETERS

MenuName
The name of the menuitem to delete

Example #1.

The following line of code will first create a base menu called MAINMENU and will then add a
new menu item which will run the subroutine OPENFORM whenever it is clicked. Finally, the
AR menu will be deleted.

MENUBASEADD(“Main Menu”//MainMenu//)

MENUADD(MainMenu//”Accounts Receivable”//AR//”RUNSUB(openform)”)

MENUDELETE(AR)

MOVE
This function will MOVE and SIZE the control specified by the TAG command.

MOVE(tag // Left // Top // Width // Height)

PARAMETERS

tag
The TAG value of one of the controls on your form.
Left, Top, Width, Height
The coordinates you wish to move/size this control to. All sizes are in TWIPS

Example#1:

151
I T ’ S A S E A S Y A S A - B - C !

To move and size the control:

MOVE(mytext//1000//500//2500//250)

MOVEFIRST
This function will move to the FIRST record in the current table.

MOVEFIRST(subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

Example:
MOVEFIRST()

MOVELAST
This function will move to the LAST record in the current table.

MOVELAST(subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

Example:
MOVELAST()

MOVENEXT
This function will move to the next record in the current table.

MOVENEXT(subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

Example:

152
I T ’ S A S E A S Y A S A - B - C !

MOVENEXT()

MOVEPREV
This function will move to the previous record in the current table.

MOVEPREV(subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

Example:
MOVEPREV()

MOVETO
This function will move to the specified record of a particular subform.

MOVETO(Subform // Record)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.
Record
The record number you wish to move to.

Example:
th
To move to the 10 record on the main form’s datasource:

MOVETO(0//10)

OUTLOOKADD
This statement will add a new item to the selected collection.
OUTLOOKADD(collection//display?)

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task
DISPLAY
1 = Yes
0 = No

OUTLOOKDELETE
This statement will delete the specified item from the selected collection.

153
I T ’ S A S E A S Y A S A - B - C !

OUTLOOKADD(collection//OutlookID)

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task
OUTLOOKID
See OUTLOOKID() function for more info
OUTLOOKDISPLAY
This statement will display the current outlook item, allowing the user to
view/modify.
OUTLOOKDISPLAY(collection)

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task
OUTLOOKSORT
This statement will sort the specified collection by the field indicated.
OUTLOOKSORT(collection//fieldname//descending?)

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task
Fieldname
Please see Appendix L for a list of available field names
Descending
TRUE or FALSE

OUTLOOKWRITE
This statement will write to the specified field of the outlook item indicated.
OUTLOOKWRITE(collection//OutlookID//fieldname//Value)

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task
OutlookID
See OUTLOOKID() function
FieldName
Please see Appendix L for a list of available field names
Value
The value to write.

PLAYSOUND
The function will play a *.wav sound file.

PLAYSOUND(FilePath // Synchronous?)

154
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

Filepath
The full path to the *.wav file you wish to play.
Syncrhonous?
Enter 1 = Synchronous 2 = Asynchronous

To play a sound file:


PLAYSOUND(“/My Documents/MySound.wav”//1)

POWERPICK
This function will display a picklist allowing the user to rapidly select a value.

POWERPICK(tag // SQL // Server // Remote Index // Distinct //


DataColumn // ColumnWidths)

PARAMETERS

tag
The TAG value of one of the controls on your form. This is the control that the user-selected value will
be stored to OR a memory variable to store the value to.
SQL
The sql statement used to populate the PowerPick list. A hard coded set of values may also be used by
entering a comma delimited list of values. Always ensure that both the SQL and the Hard-coded list are
surrounded by double quotes
Server
The Server used to query against .. use --- for the local device
Remote Index
The remote index (Only used for remote tables ... otherwise leave blank).
Distinct (OPTIONAL)
TRUE = Only show distinct values
FALSE = Show ALL values
NOTE: In order for DISTINCT to work properly, you must ensure that your SQL returns data sorted
st
ASCENDING. Distinct works with values in the 1 column of your data.
DataColumn (OPTIONAL)
A ‘zero based’ value which determines the column you wish to retrieve the value of. For example, if you
have chosen to display the following fields: FIRSTNAME,LASTNAME,ID you could retrieve the ID of
the chosen customer by using 2 as your DataColumn value.
ColumnWidth (OPTIONAL)s
The column widths in TWIPS. ie. To set the 1st 4 columns enter the following: 1000,2000,1500,4000.

To display a PowerPick list you could use the following syntax:

POWERPICK(TEXT1//"SELECT myField FROM myTable"//"---"//)

To fill the PowerPick with a hardcoded list of Months, you would enter:

POWERPICK(TEXT1 //"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"//"---"//)

To fill the PowerPick with a hardcoded list of Months AND save the value to a memory
variable called MONTH, you would enter:

POWERPICK(<!MONTH!>//"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"//"---"//)

155
I T ’ S A S E A S Y A S A - B - C !

PRINT
This statement will PRINT the current form. (Note: abcDB™ 'Printing' versions
only!)

PRINT(value)

PARAMETERS

value
1 = Prints CURRENT form only
2 = Brings up dialog box allowing user to choose which records to print

To print the current record only:

PRINT(1)

To allow the user to select which records to print:


PRINT(2)

PROPSET
This statement will allow you to set various properties to the specified control.
PROPSET(control//property//value)

PARAMETERS

Control
The TAG value of one of the controls on your form.
Property
The specific ‘propertry’ of the control you wish to modify
Value
The value you wish to set

Example:
To change the caption of the button with a tag name of btnCancel to SAVE:

PROPSET(btnCancel//”text”//”SAVE”)
QUIT
This function will close all forms and exit back to the main abcDB™ console.

QUIT()

PARAMETERS

NONE

To close the current form:

QUIT()

RECORDDELETE
Will delete the current record.

156
I T ’ S A S E A S Y A S A - B - C !

RECORDDELETE(subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

RECORDDELETE()

RECORDNEW
This function will position the form on a new empty record.

RECORDNEW(Subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

Example:
RECORDNEW()

RECORDSAVE
Will save the current record.

RECORDSAVE(subform)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

RECORDSAVE()

REGISTRYDEL
Will delete the specified registry key
REGISTRYDEL(section//key)

PARAMETERS

157
I T ’ S A S E A S Y A S A - B - C !

Section
The section (ie. “\Software\abcDB\User\”)
Key
The specific key to delete (if blank, delete whole section)
REGSETINT
Will set the integer value of the specified registry key
REGSETSTR(section//key//value)

PARAMETERS

Section
The section (ie. “\Software\abcDB\User\”)
Key
The specific key to set
Value
The value to set
REGSETSTR
Will set the string value of the specified registry key
REGSETSTR(section//key//value)

PARAMETERS

Section
The section (ie. “\Software\abcDB\User\”)
Key
The specific key to set
Value
The value to set
RETURN
This statement will cause code execution to return to the calling statement.
RETURN()

PARAMETERS

NONE

Example:

:Square
SETMEM(<!VALUE!>//<!VALUE!>*<!VALUE!>)
RETURN()
RUNAPP
Executes an external program.

RUNAPP(ProgramPath//Parameters)
PARAMETERS

ProgramPath
The path of the program to execute
Parameters
Any parameters you wish to pass to the executed program.

EXAMPLE:
To send an email using Pocket Internet Explorer, you could do the following:
RUNAPP(“/windows/iexplore.exe”//”mailto:support@PocketSOFT.ca”)

158
I T ’ S A S E A S Y A S A - B - C !

To run an external ‘visual basic’ program, you could try this:


RUNAPP("/Windows/pvbload.exe", "/foldername/programname.vb”)
RUNSUB
Executes a subroutine found in any of the 5 Modules in the current database.
RUNSUB(Subroutine)
PARAMETERS

Subroutine
The name of the subroutine to execute

EXAMPLE:
If you had a subroutine called EMAIL in Module1, you could call it from any other code in
your application by using the following line of code:

RUNSUB(Email)
RUNSQL
Executes the SQL statement supplied against the server specified.

RUNSQL(sql // Server)

PARAMETERS

SQL
The sql statement to execute
Server
The Server used to query against .. use --- for the local device

EXAMPLE:

To insert a record into a table:

RUNSQL("INSERT INTO myTable (field1,field2,field3) values (value1,value2,value3)"//"---


")

To delete all the records in a table:

RUNSQL("DELETE from MyTable"//"---")

RUNUPDATE
Updates the specified field with the value chosen.

RUNUPDATE(field// value // SQL // Server)

PARAMETERS

Field
The field to update
Value
The value to insert into the field
SQL
The SQL statement that will return the correct records to update.
Server
The server to execute this statement against (Note: Use --- for local device)

159
I T ’ S A S E A S Y A S A - B - C !

To change change all phone numbers from 555-1313 to 555-1212:

RUNUPDATE("PhoneNumber"//"555-1212"//"SELECT * FROM CONTACTS WHERE


PhoneNumber = '555-1313'"//"---")

SCRIBCLEAR
This function clear the contents of the scribble control.

SCRIBCLEAR(tag)

PARAMETERS

TAG
The tagname of the scribble control you wish to clear

To clear the scribble control with tag name of PICTURE


SCRIBCLEAR(Picture)
SCRIBFSAVE
This statement allows you to save the contents of the Scribble control to an external
BMP file.

SCRIBFSAVE(Filename//Tag)

PARAMETERS

Filename
The full PATH including file name you wish to save the scribble contents.
Tag
The tagname of the scribble whose contents you wish to save.

SCRIBFSAVE(“/My Documents/MyScrib.bmp”)

SCRIBSAVE
This statement saves the contents of the Scribble control to the field it is currently
bound to.
SCRIBSAVE()

PARAMETERS

None

SCRIBSAVE()

SCRIBLOAD
This statement loads the contents of the Scribble control from the filename
specified.
SCRIBLOAD(filename)

PARAMETERS

None

160
I T ’ S A S E A S Y A S A - B - C !

SCRIBLOAD(“\My Documents\MyScribble.bmp”)

SETFIELD
The function will store a value in a field located either in the FORM's recordset or
the GRID's recordset.

SETFIELD(FORM or GRID // FIELD // VALUE)

PARAMETERS

FORM OR GRID
Enter either FORM or GRID depending on which record source you want to update.
FIELD
The name of the field
Value
The value to place in the field

Example#1:
To store the value of 19.89 in the field MyField that is in the currently selected record of the
FORM.
SETFIELD(FORM//myField//19.89)
Example#2:
To store the value of 19.89 in the field MyField that is in the currently selected record of the
GRID.
SETFIELD(GRID//myField//19.89)

SETFOCUS
This function will set the focus to any control on your form which has a valid TAG
value.

SETFOCUS(tag)

PARAMETERS

tag
The TAG value of one of the controls on your form.

EXAMPLE:
Assuming that you have two Textboxes on your form, one with a TAG value of FIELD1 and
another with a TAG value of FIELD2, you could perform the following operation:

SETFOCUS(FIELD1)

This would set the focus to the FIELD1 textbox

SETMEM
This function will create/set a memory variable.

SETMEM(VARIABLE NAME // VALUE)

161
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

VARIABLE NAME
The name of the variable you wish to store the value to.
VALUE
The value you wish to store in VARIABLENAME

Example:
To save the value in the txtCITY textbox in a variable named CITY.
SETMEM(CITY//~txtCity~)

NOTE: To retrieve memory variables, you can refer to them in statements using the
following syntax:

<!CITY!>
You must surround the variable name with <! !> tags

SETTAB
This statement will position the tab control to the tab specified.
SETTAB(value)
PARAMETERS

value

The tab page to set focus to.


SETVALUE
The function will store a value in either a field or a form object on the current form.

SETVALUE(FIELDNAME or TAG // Value)

PARAMETERS

FIELDNAME or TAG
Either a valid Field name contained in the current forms table OR the TAG value of one of the controls
on your form
Value
The value to insert.

Example#1:
To store the value of 19.89 in the field FIELD1:
SETVALUE("FIELD1"//19.89)
Example#2:
To store the value of 19.89 in the textbox referenced by TAG MyText:
SETVALUE(~MyText~//19.89)

SIP
This statement shows or hides the keyboard on your PocketPC.
SIP(SHOW or HIDE)

Example:
To show the keyboard:

162
I T ’ S A S E A S Y A S A - B - C !

SIP(SHOW)
SUBFORMREFRESH
This statement will requery the specified subform datasource.
SUBFORMREFRESH(Subform//SQL)
PARAMETERS

Subform

1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5

SQL

The SQL statement to populate the subform with.

EXAMPLE
To requery the 3rd subform datasource with all customer names:
SUBFORMREFRESH(3//'SELECT name FROM tblCustomers")
TABLEDELETE
This statement will delete a table from your current database.
TABLEDELETE(TableName//IsRemote?)

PARAMETERS

TableName
The name of the table you wish to delete.
IsRemote?
Determines if the table is a ‘remote’ table.

TABLEDELETE(“MyTable”//”FALSE”)
TEST
This statement will execute a number of statements depending on the value of an
expression.

TEST(LeftExpression // Operator // RightExpression)

ENDTEST()

PARAMETERS

Left Expression
The left hand side of an expression (ie. In the expression FIELD1 <> FIELD2, FIELD1 is the
LeftExpression
Operator
The operator of an expression (ie. In the expression FIELD1 <> FIELD2, <> is the operator.

= Equality

163
I T ’ S A S E A S Y A S A - B - C !

< Less than


> Greather than
<= Less than or equal to
>= Greater than or equal to
<> Not equal

Right Expression
The right hand side of an expression (ie. In the expression FIELD1 <> FIELD2, FIELD2 is the
RightExpression

Assuming that you have two Textboxes on your form, one with a TAG value of FIELD1 and
another with a TAG value of FIELD2, you could perform the following operation:

TEST(~FIELD1~//=//~FIELD2~)
[statements]
ELSE()
[statements]
ENDTEST()

TIMER
This statement allows you to adjust the FORM Timer.

TIMER(Enabled Or Interval // TRUE/FALSE or INTERVAL)

PARAMETERS

Enabled OR Interval
Enter ENABLED or INTERVAL
TRUE/FALSE or INTERVAL
Enter either TRUE or FALSE … OR the Interval (1000 = 1 second)

TIMER(ENABLED//TRUE) 'Enables the timer


TIMER(INTERVAL//1000) 'Sets the interval to 1 Second increments
TIMER(ENABLED//FALSE) 'Disables the timer

TREEADDNODE
This Statement will add another ‘node’ to the specified treeview control
TREEADDNODE(tagname//nodeID//Text//Checkbox?)

PARAMETERS

Tagname
The tag of the treeview control you wish to use
NodeID
The ID of the particular node you wish to add to.
Textr
The text you wish to initially set new node to
Checkbox
Display checkbox?
0=No
1=Yes

TREEDELNODE
This Statement will DELETE a ‘node’ from the specified treeview control
TREEDELNODE(tagname//nodeID)

164
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

Tagname
The tag of the treeview control you wish to use
NodeID
The ID of the particular node you wish to add to. (If blank, clear ALL nodes)

TREESET
This Statement will set a particular nodes text.
TREESET(tagname//nodeID//Text)

PARAMETERS

Tagname
The tag of the treeview control you wish to use
NodeID
The ID of the particular node you wish to add to.
Textr
The text you wish to initially set new node to

VISIBLE
This function will make the control specified either visible or invisible.

VISIBLE(tag // TRUE/FALSE)

PARAMETERS

tag
The TAG value of one of the controls on your form.
TRUE/FALSE
Enter TRUE to make the control visible … enter FALSE to hide the control

Example:
To HIDE the textbox with a tag name of myText:

VISIBLE(mytext//FALSE)
To SHOW the textbox with a tag name of myText:

VISIBLE(mytext//TRUE)

WHILE/ENDWHILE
Executes statements while the condition specified remains true.

WHILE(LeftExpression // Operator // RightExpression)


[statements]
ENDWHILE()

PARAMETERS

Left Expression
The left hand side of an expression (ie. In the expression FIELD1 <> FIELD2, FIELD1 is the
LeftExpression
Operator
The operator of an expression (ie. In the expression FIELD1 <> FIELD2, <> is the operator.

= Equality
< Less than

165
I T ’ S A S E A S Y A S A - B - C !

> Greather than


<= Less than or equal to
>= Greater than or equal to
<> Not equal

Right Expression
The right hand side of an expression (ie. In the expression FIELD1 <> FIELD2, FIELD2 is the
RightExpression

Example:

WHILE(~FIELD1~//=//~FIELD2~)
[statements]
ENDWHILE()

WINDOWPOS
This statement allows you to reposition the viewable area of the form.

WINDOWPOS(Left // Top)

PARAMETERS

Left
The TOP-X position of the windows top left corner in TWIPS
Top
The TOP-Y position of the windows top left corner in TWIPS

To position the window so the top left corner of the visible screen is at coordinates
1000,1000:

WINDOWPOS(1000//1000)

ZOOM
This function gives the user a much larger area in which they can enter data. It’s
particularly useful since it saves ‘space’ on your form. You could for example
have a small textbox for entering notes, and by means of the ‘zoom’ function, the
user can then enter the notes much easier.
ZOOM(tag)

PARAMETERS

tag
The TAG value of one of the controls on your form.

Example:
ZOOM(MyControl)
ZORDER
This function will change the ZORDER value of the chosen control.

ZORDER(tag // Value)

166
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

tag
The TAG value of one of the controls on your form.
Value
0 = BringToFront
1 = SendToBack

Example:
ZORDER(MyControl//0) 'This would bring the control to the TOP of the z-order stack

167
I T ’ S A S E A S Y A S A - B - C !

D
Appendix

abcDB™ Form controls


(Properties and Events)

FORM
Every abcDB™ ‘FORM’ has it’s own properties and events.
The abcDB™ FORM supports the following properties.

Property Name Description

SQL The SQL statement that is used to ‘populate’ all the controls on this form.
Ie.

SELECT * FROM CUSTOMERS

Caption The ‘text’ that will be displayed at the top of this form.
Ie.
Customer List

Auto Start? Determines whether this form will automatically be displayed whenever this
database is opened.

Back Color The background color for the entire form.

Navigation Determines whether the navigation menu at the top of the screen will be
Menu displayed or not.

Close Button? Determines whether the CLOSE button at the bottom of the screen will be
displayed or not.

Data Mode Determines what ‘mode’ this form will be opened with:

0 = Add Data

168
I T ’ S A S E A S Y A S A - B - C !

1 = Edit Data
2 = Read Only

Password If a value is entered here, you will only be able to ‘edit’ this form again by
entering the password.

Scrollbar(Horiz) Determines whether the Horizontal scrollbar will be visible.

Scrollbar(Vert) Determines whether the Vertical scrollbar will be visible.

Data Server The remote server used to execute the SQL statement against. NOTE: Use “-
--“ for Local Device.

Remote Index The name of the ‘Primary Key’ field in your remote table.

Remote Table The name of the remote table being queried.

Timer Enabled? Determines whether the forms ‘timer’ will be enabled or not. The forms
TIMER allows you to execute code at predefined intervals. Useful for
refreshing data automatically, updating an onscreen clock, etc…

Timer Interval The interval at which the timer-event will fire. In milliseconds. 1000 = 1
Second.

Subform1 An SQL statement which returns a recordset that you can bind controls to.

Subform2 An SQL statement which returns a recordset that you can bind controls to.

Subform3 An SQL statement which returns a recordset that you can bind controls to.

Subform4 An SQL statement which returns a recordset that you can bind controls to.

Subform5 An SQL statement which returns a recordset that you can bind controls to.

Module1 Up to 32,000 characters of code. May contain many different ‘subroutines’


which may be called from any other code in your applicaton.
Note: Modules 1-5 are not specific to any one form. Any code entered into
any of these modules will be available from EVERY other form.

Module2 Up to 32,000 characters of code. May contain many different ‘subroutines’


which may be called from any other code in your applicaton.
Note: Modules 1-5 are not specific to any one form. Any code entered into
any of these modules will be available from EVERY other form.

Module3 Up to 32,000 characters of code. May contain many different ‘subroutines’


hi h b ll d f h d i li
169
I T ’ S A S E A S Y A S A - B - C !

which may be called from any other code in your applicaton.


Note: Modules 1-5 are not specific to any one form. Any code entered into
any of these modules will be available from EVERY other form.

Module4 Up to 32,000 characters of code. May contain many different ‘subroutines’


which may be called from any other code in your applicaton.

Note: Modules 1-5 are not specific to any one form. Any code entered into
any of these modules will be available from EVERY other form.

Module5 Up to 32,000 characters of code. May contain many different ‘subroutines’


which may be called from any other code in your applicaton.
Note: Modules 1-5 are not specific to any one form. Any code entered into
any of these modules will be available from EVERY other form.

The FORM supports the following EVENTS.


Event Name Description

On Current This event is executed whenever a new record is displayed.

On Add This event is executed whenever a new record is ADDED.

On Delete This event is executed whenever a record is DELETED.

On Open This event is executed whenever a form is initially OPENED.

Timer Event This event is executed at predefined intervals as determined by the forms
TIMER INTERVAL and TIMER ENABLED properties.

TextBox Control
This control displays information entered by the user at run time or assigned to the Text property
of the control at design or run time.

The TextBox control supports the following properties.


Property Name Description

Back Color Background Color

Bound Field The Field from which this textbox will receive its data, or in other words, the
fi ld h hi b ill b ‘b d’
170
I T ’ S A S E A S Y A S A - B - C !

field that this textbox will be ‘bound’ to.


ie. The bound field property can also contain a calculation. For example, in an invoicing
application, it might be beneficial to automatically display the amount of tax applicable
based on the net invoice amount. If the net invoice amount was contained in a textbox with a
TAG name of ~AMOUNT~, you could enter the following in the TAX textboxes Bound Field
property:

= ~AMOUNT~ * .07

Format This property customizes that way that the data in this textbox will be
displayed. Options include PERCENTAGE, CURRENCY, and NONE.
ie. If a textbox contained the number 0.99 and the FORMAT property was set to
PERCENTAGE, the value would be displayed as 99.00%

ie. If a textbox contained the number 0.99 and the FORMAT property was set to
CURRENCY, the value would be displayed as $0.99

Default This property determines the default value that will be used to populate this
textbox whenever a new record is added.

For example, if you have a date field, you could automatically populate this field with the
current date by entering the following for the DEFAULT property:

DATE()

Alternatively, you could also set the default property to be a simple calculation, such as the
following:

= ~TEXTBOX1~ * .07

Enabled Specifies if this textbox will be enabled or disabled

Font The FONT this textbox will use.

Font Size The SIZE of the font this textbox will use.

Font Bold Specifies if the font will be displayed in BOLD.

Font Italic Specifies if the font will be displayed in ITALIC.

Font Underline Specifies if the font will be displayed in UNDERLINE.

Fore Color The foreground color of this textbox.

Tag You can use the Tag property to specify or determine the string that identifies
the name of a textbox. Thereafter, the contents of that textbox can be referred
to elsewhere in the application using the syntax ~TAGNAME~.
ie. If a textbox is bound to the CITY field of a customers table, you could give this textbox a

171
I T ’ S A S E A S Y A S A - B - C !

TAG name of CITY, which can then be used elsewhere by using the syntax ~CITY~.

Visible Specifies whether this textbox will be visible or invisible

Height The height of this textbox in Twips*

Width The width of this textbox in Twips*

Left The horizontal location of the top-left corner of this textbox in Twips*

Top The vertical location of the top-left corner of this textbox in Twips*

Barcode? Specifies whether this textbox will be printed as a textbox OR as a


BARCODE. (Note: This property is only valid in ‘printing’ versions of
abcDB™)

Print Border? Specifies whether this textbox will be printed with a border or no border
(Note: This property is only valid in ‘printing’ versions of abcDB™)

The TextBox control supports the following EVENTS.


Event Name Description

Got Focus The got-focus event fires whenever this textbox receives the focus.

Lost Focus The lost-focus event fires whenever this textbox loses the focus.

Dropdown Control
This control adds to the features of a text box by allowing the user to select an item either by
typing text into the DROPDOWN control or by selecting it from the list.
The DROPDOWN control supports the following properties.
Property Name Description

Back Color Background Color

Bound Field The Field from which this DROPDOWN will receive it’s data, or in other
words, the field that this DROPDOWN will be ‘bound’ to.

Default This property determines the default value that will be used to populate this
DROPDOWN whenever a new record is added. For example, if you have a
date field, you could automatically populate this field with the current date by

172
I T ’ S A S E A S Y A S A - B - C !

entering the following for the DEFAULT property:


DATE()
Alternatively, you could also set the default property to be a simple
calculation, such as the following:

= ~TEXTBOX1~ * .07

Enabled Specifies if this DROPDOWN will be enabled or disabled

Font The FONT this DROPDOWN will use.

Font Size The SIZE of the font this DROPDOWN will use.

Font Bold Specifies if the font will be displayed in BOLD.

Font Italic Specifies if the font will be displayed in ITALIC.

Font Underline Specifies if the font will be displayed in UNDERLINE.

Fore Color The foreground color of this DROPDOWN.

SQL The SQL property will determine what items are contained in the dropdown
list. You can either enter an SQL statement that returns ONE field, OR you
can also enter a hard-coded list of items which are separated by commas.
Ie. To display all the different cities that your customers live in:
”SELECT city FROM customers”

Ie. To display all the months of the year for your user to select from:
”Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec”

Tag You can use the Tag property to specify or determine the string that identifies
the name of a DROPDOWN. Thereafter, the contents of that DROPDOWN
can be referred to elsewhere in the application using the syntax
~TAGNAME~.
ie. If a DROPDOWN is bound to the CITY field of a customers table, you
could give this DROPDOWN a TAG name of CITY, which can then be used
elsewhere by using the syntax ~CITY~.

Visible Specifies whether this DROPDOWN will be visible or invisible

Width The width of this DROPDOWN in Twips*

Left The horizontal location of the top-left corner of this DROPDOWN in Twips*

Top The vertical location of the top-left corner of this DROPDOWN in Twips*

173
I T ’ S A S E A S Y A S A - B - C !

Barcode? Specifies whether this DROPDOWN will be printed as a DROPDOWN OR


as a BARCODE. (Note: This property is only valid in ‘printing’ versions of
abcDB™)

Print Border? Specifies whether this DROPDOWN will be printed with a border or no
border (Note: This property is only valid in ‘printing’ versions of abcDB™)

The DROPDOWN control supports the following EVENTS.


Event Name Description

On Click This event fires whenever a user selects an item from the list. There are many
uses for the ON CLICK event.
Ie.In an Automobile dealership, it might be useful to be able to quickly view all the vehicles of
a given year. You could add a DROPDOWN box which contains a list of all the years (ie.
1996, 1997, 1998, 1999, 2000, 2001, 2002).

Once a user selects (taps) a year in the dropdown box, you could execute a FORMREQUERY
statement to display only those vehicles which match the year chosen.

Label Control
This control displays text that cannot be edited by the user.
The Label control supports the following properties.
Property Name Description

Alignment Determines whether the text of this label will be left justified, right justified
or center justified.

Back Color Background Color

Caption The text that this label will display.

Font The FONT this LABEL will use.

Font Size The SIZE of the font this LABEL will use.

Font Bold Specifies if the font will be displayed in BOLD.

Font Italic Specifies if the font will be displayed in ITALIC.

Font Underline Specifies if the font will be displayed in UNDERLINE.

Fore Color The foreground color of this LABEL.

174
I T ’ S A S E A S Y A S A - B - C !

Tag You can use the Tag property to specify or determine the string that identifies
the name of a LABEL.

Visible Specifies whether this LABEL will be visible or invisible

Height The height of this LABEL in Twips*

Width The width of this LABEL in Twips*

Left The horizontal location of the top-left corner of this LABEL in Twips*

Top The vertical location of the top-left corner of this LABEL in Twips*

The LABEL control supports the following EVENTS.


Event Name Description

On Click The ON CLICK event fires whenever this label is ‘tapped’.

Command Control
This control is used to begin a process. Tapping the COMMAND Button executes the command
that is written into its ONCLICK event procedure.
The Command control supports the following properties.
Property Name Description

Caption The text that this button will display.

Default Button? If a command button is chosen to be the DEFAULT button, it will


automatically be ‘tapped’ whenever a carriage return is enter. This is very
useful when using BARCODE Scanners. Most barcode scanners can be
programmed to send ‘carriage returns’ after the scan. As a result, you can
add a DEFAULT Command button to your form, and the abcDB™ ‘script’
code contained in the ONCLICK event of that button will be executed
whenever you ‘scan’ a new item.

Font The FONT this COMMAND Button will use.

Font Size The SIZE of the font this COMMAND Button will use.

Font Bold Specifies if the font will be displayed in BOLD.

Font Italic Specifies if the font will be displayed in ITALIC.

175
I T ’ S A S E A S Y A S A - B - C !

Font Underline Specifies if the font will be displayed in UNDERLINE.

Fore Color The foreground color of this COMMAND Button.

Tag You can use the Tag property to specify or determine the string that identifies
the name of a COMMAND Button.

Visible Specifies whether this COMMAND Button will be visible or invisible

Height The height of this COMMAND Button in Twips*

Width The width of this COMMAND Button in Twips*

Left The horizontal location of the top-left corner of this COMMAND Button in
Twips*

Top The vertical location of the top-left corner of this COMMAND Button in
Twips*

The COMMAND control supports the following EVENTS.


Event Name Description

ONCLICK This event is executed whenever this COMMAND button is ‘tapped’.

Checkbox Control
This control contains items that appear checked when selected. Check boxes commonly are used
to present a yes or no choice or a TRUE or FALSE choice to the user.
The CHECKBOX control supports the following properties.
Property Name Description

Back Color Background Color

Bound Field The Field from which this CHECKBOX will receive it’s data, or in other
words, the field that this CHECKBOX will be ‘bound’ to.
NOTE: The bound field MUST be a field of type ‘boolean’

Caption The descriptive text that this checkbox will contain.

Default This property determines the default value that will be used to populate this
CHECKBOX whenever a new record is added.

Enabled Specifies if this CHECKBOX will be enabled or disabled

176
I T ’ S A S E A S Y A S A - B - C !

Font The FONT this CHECKBOX will use.

Font Size The SIZE of the font this CHECKBOX will use.

Font Bold Specifies if the font will be displayed in BOLD.

Font Italic Specifies if the font will be displayed in ITALIC.

Font Underline Specifies if the font will be displayed in UNDERLINE.

Fore Color The foreground color of this CHECKBOX.

Tag You can use the Tag property to specify or determine the string that identifies
the name of a CHECKBOX. Thereafter, the contents of that CHECKBOX
can be referred to elsewhere in the application using the syntax
~TAGNAME~.
ie. If a CHECKBOX is bound to the TAXABLE field of a customers table,
you could give this CHECKBOX a TAG name of TAXABLE, which can
then be used elsewhere by using the syntax ~TAXABLE~.

Visible Specifies whether this CHECKBOX will be visible or invisible

Height The height of this CHECKBOX in Twips*

Width The width of this CHECKBOX in Twips*

Left The horizontal location of the top-left corner of this CHECKBOX in Twips*

Top The vertical location of the top-left corner of this CHECKBOX in Twips*

The CHECKBOX control supports the following EVENTS.


Event Name Description

Lost Focus The lost-focus event fires whenever this CHECKBOX loses the focus.

Grid Control
The Grid control is a control that provides a visual interface to display data in table form. The
Grid control is divided into rows and columns. An intersection of a row and a column is called a
cell.
The GRID control supports the following properties.

177
I T ’ S A S E A S Y A S A - B - C !

Property Name Description

Allow Adding Determines whether the user will be able to ADD a new record by entering
data in the bottom line of the GRID.

Allow Deleting Determines whether the user will be able to DELETE records from the GRID.
You can delete records by ‘tap-n-holding’ on the chosen row until a menu
pops up. You can then choose to DELETE using the appropriate menu
option.

Allow Edits Determines whether the user will be able to ‘modify’ or ‘change’ the contents
of the grid.

Back Color Background Color

Column Widths This property allows you to specify the widths of the columns in your grid.
All widths are measure in TWIPS, and must be separated by commas.
Ie. To set the 1st 4 columns enter the following: 1000,2000,1500,4000

Fore Color The foreground color of this GRID.

SQL The SQL statement used to populate the grid. Make sure that the SQL
statement is surrounded by double quotes.
Ie. To display all the Inventory items which cost more than $50.00, you could enter the
following in the SQL property of a GRID.

“SELECT Item,Description,Weight,Color FROM Inventory WHERE price > 50”

Link Field The name of a field in the record source of your GRID control which
(Child) corresponds to your LINK FIELD (MASTER).
If this property and the LINK FIELD(MASTER) property are correctly set
up, any new records added in the grid will contain the correct link value.

Link Field The name of a field in the record source of your FORM which corresponds to
(Master) your LINK FIELD (CHILD).

Tag You can use the Tag property to specify or determine the string that identifies
the name of a GRID.

Visible Specifies whether this GRID will be visible or invisible

Data Server The remote server that this GRID’s data will be retrieved from. Use “---“ for
the local device.

Remote Index The name of the remote index (PRIMARY KEY) that is used for updating
d

178
I T ’ S A S E A S Y A S A - B - C !

data.

Remote Table The name of the remote table that this GRID’s data is based on.

Height The height of this GRID in Twips*

Width The width of this GRID in Twips*

Left The horizontal location of the top-left corner of this GRID in Twips*

Top The vertical location of the top-left corner of this GRID in Twips*

The GRID control supports the following EVENTS.


Event Name Description

On Add The event is executed whenever a new record is added by entering new data
in the bottom row of a GRID.

On Current This event is executed whenever a new cell receives the focus.

On Delete This event is executed whenever a record is deleted.

After Update This even is executed whenever data is modified.

Date Field Control


This control allows the user to quickly and easily choose a date from an on-screen calendar.
The DatePicker control supports the following properties.
Property Name Description

Bound Field The Field from which this DATEPICKER will receive it’s data, or in other
words, the field that this DATEPICKER will be ‘bound’ to.

Default This property determines the default value that will be used to populate this
DATEPICKER whenever a new record is added. For example, if you have a
date field, you could automatically populate this field with the current date by
entering the following for the DEFAULT property:

DATE()

Tag You can use the Tag property to specify or determine the string that identifies
the name of a DATEPICKER. Thereafter, the contents of that
DATEPICKER can be referred to elsewhere in the application using the

179
I T ’ S A S E A S Y A S A - B - C !

syntax ~TAGNAME~.
ie. If a DATEPICKER is bound to the INVOICEDATE field of an orders
table, you could give this textbox a TAG name of INV_DATE, which can
then be used elsewhere by using the syntax ~ INV_DATE ~.

Visible Specifies whether this DATEPICKER will be visible or invisible

Height The height of this DATEPICKER in Twips*

Width The width of this DATEPICKER in Twips*

Left The horizontal location of the top-left corner of this DATEPICKER in


Twips*

Top The vertical location of the top-left corner of this DATEPICKER in Twips*

Print Border? Specifies whether this DATEPICKER will be printed with a border or no
border (Note: This property is only valid in ‘printing’ versions of abcDB™)

The DatePicker control does not support any EVENTS.

Scribble Control
This control allows the user to ‘scribble’ or draw free-hand text. It is very useful for capturing
signatures, quick drawings, etc…
The Scribble control supports the following properties.
Property Name Description

Back Color Background Color

Bound Field The Field from which this SCRIBBLE will receive it’s data, or in other
words, the field that this SCRIBBLE will be ‘bound’ to.

NOTE: This field MUST be a field of type OLE.

Fore Color The foreground color of this SCRIBBLE.

Tag You can use the Tag property to specify or determine the string that identifies
the name of a SCRIBBLE. Thereafter, the contents of that SCRIBBLE can
be referred to elsewhere in the application using the syntax ~TAGNAME~.

This is useful especially for using the SCRIBCLEAR(), SCRIBSAVE() and


SCRIBFSAVE() commands. (See Appendix for details)

180
I T ’ S A S E A S Y A S A - B - C !

Visible Specifies whether this SCRIBBLE will be visible or invisible

Height The height of this SCRIBBLE in Twips*

Width The width of this SCRIBBLE in Twips*

Left The horizontal location of the top-left corner of this SCRIBBLE in Twips*

Top The vertical location of the top-left corner of this SCRIBBLE in Twips*

The Scribble control does not support any EVENTS.

Image Control
The IMAGE control allows you to display images of type BMP. Please note that all images must
be at least 256 colors or LESS, otherwise no image will be displayed.

The Image control supports the following properties.


Property Name Description

Back Color Background Color

Bound Field NOT USED

Fore Color The foreground color of this IMAGE.

Tag You can use the Tag property to specify or determine the string that identifies
the name of an IMAGE control. Thereafter, the contents of that textbox can
be referred to elsewhere in the application using the syntax ~TAGNAME~.

This is especially useful when using the IMAGE() commands. See appendix
for details.

Visible Specifies whether this IMAGE will be visible or invisible

Height The height of this IMAGE in Twips*

Width The width of this IMAGE in Twips*

Left The horizontal location of the top-left corner of this IMAGE in Twips*

Top The vertical location of the top-left corner of this IMAGE in Twips*

Path Type You can either select of the following options:


1. PATH IN FIELD - Indicates that the path to the image file is contained in

181
I T ’ S A S E A S Y A S A - B - C !

a field. Once you select this option, the very next property in the list will
change to DYNAMIC PATH, allowing you to choose the appropriate field.

2. FIXED PATH – Indicates that the path to the image is a fixed path that
does not change. Useful for displaying logos and other images that will
remain constant. Once this option is chosen the very next property in the
property list will change to FIXED PATH allowing you to enter the path.

FIXED PATH As described in the previous PATH TYPE property.


or
DYNAMIC
PATH

Stretch? Determines whether the image will be ‘stretched’ to fit the size of the image
control.

TAB Control
The TAB control allows you to display controls as if they were on different pages or dividers in a
notebook. The TAB control will allow you to design your screen so that it is much easier to use,
and you can get more information on the screen at the same time.

The TAB control supports the following properties.


Property Name Description

182
I T ’ S A S E A S Y A S A - B - C !

Tabs This property allows you to change the number of tabs showing. Enter your
required tabs in the following format:

Tabname1,Tabname2,Tabname3
You could thus create a TAB control that contains a page for CUSTOMER
information, a page for INVOICE info, and a page for INVENTORY by
putting the following in the ‘tabs’ property:
Customer,Invoice,Inventory

*NOTE: In design mode, there will always be at least two tabs visible,
however if you wish, you can have a tab with only one page.

On Click This ‘event’ will be fired whenever someone changes the ‘page’ of the tab
control.

Tag You can use the Tag property to specify or determine the string that identifies
the name of the TAB control.

Visible Specifies whether this TAB will be visible or invisible

Height The height of this TAB in Twips*

Width The width of this TAB in Twips*

Left The horizontal location of the top-left corner of this IMAGE in Twips*

Top The vertical location of the top-left corner of this IMAGE in Twips*

183
I T ’ S A S E A S Y A S A - B - C !

E
Appendix

Appendix E -- abcDB™ Functions


Function Description

ABS
This function calculates the absolute value of a number. The absolute value of number is
the number without its sign. For example, Abs(–1) and Abs(1) both return 1

ABS(Number)

PARAMETERS

Number
Any numeric expression

Example:
To save the absolute value of the number currently contained in the myNUMBER textbox to the
memory variable ABSNUM:
SETMEM(ABSNUM//ABS(~myNumber~))

ASC
This function will return the ascii value of a given character.

ASC(Value)

PARAMETERS

VALUE
String.

Example:
To display the ascii value of the letter “A”:
MESSAGE(ASC(“A”)//”TEST”)
This command would return the number 65 which is the ascii value of “A”

AUTOID
This function will return a GUID (Globally Unique Identifier)

AUTOID()

184
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS
NONE

Example:
To automatically save a new GUID value into the ID field on your current form whenever a new
record is added, place the following line of code in your form’s ON ADD event. (note: Assumes
your ID field is bound to a textbox with tag value of IDFIELD)
SETVALUE(~IDFIELD~//AUTOID())

BRUSH
This function creates and returns a brush to be used in drawing operations.
BRUSH(Red,Green,Blue)

PARAMETERS

Red
Number from 0-255
Green
Number from 0-255
Blue
Number from 0-255

Example:
To return a RED brush:
BRUSH(255,0,0)
CHR
This function converts an ANSI character code to its associated character.

CHR(Value)

PARAMETERS

VALUE
Number.

Example:
To display the character associated with 65:

MESSAGE(“Code 65 is the letter” CHR(65)//”CHR TEST”)


RGBCOLOR
This function creates and returns a color.

RGBCOLOR(Red,Green,Blue)

PARAMETERS

Red
Number from 0-255
Green
Number from 0-255
Blue
Number from 0-255

Example:
To return a RED color:
RGBCOLOR(255,0,0)
CURRENTTAB
The function will return the page that the TAB control is currently positioned on.

185
I T ’ S A S E A S Y A S A - B - C !

CURRENTTAB()
PARAMETERS

NONE
DADD
This function uses a specified time interval to modify a date.

DADD(Interval , Number , Date)

PARAMETERS

Interval
Required. String expression that is the interval you want to add. The following table shows the possible values of
the interval parameter.
yyyy = Year
q = Quarter
m = Month
y = Day of year
d = Day
w = Weekday
ww = week of year
h = Hour
m = Minute
s = Second

Number
Numeric expression that is the number of interval you want to add. The numeric expression can either be
positive, for dates in the future, or negative, for dates in the past.
Date
The DATE to which INTERVAL is added.

Example:
The following code example adds one month to January 31 and stores it in a new variable called
NEWDATE:
SETMEM(NEWDATE//DADD(m, 1, "01/31/02"))
message(<!newdate!>//”NEWDATE Equals:”)

DATE
This function return the current system date.

DATE()

PARAMETERS

NONE

Example:
To automatically store the current date in your InvoiceDate field whenever a new record is
added, add the following code to your forms ON ADD event: (Note: assumes you have bound
the InvoiceDate field to a textbox with TAG name of InvoiceDate)
SETVALUE(~InvoiceDate~//DATE())

DATETIME
Returns the current system date and time.

DATETIME()

186
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS
NONE

Example:
To automatically store the current system date and time in your InvoiceDate field whenever a
new record is added, add the following code to your forms ON ADD event: (Note: assumes you
have bound you’re the InvoiceDate field to a textbox with TAG name of InvoiceDate)
SETVALUE(~InvoiceDate~//DATETIME())

DAY
This function determines the day of the month from a specified date, and returns a
number from 1 to 31.

DAY(Date)

PARAMETERS

DATE
Any date.

Example:
To return the day of the month from the date contained in a textbox with TAG name of
InvoiceDate:
MESSAGE(DAY(~InvoiceDate~)//”Day of month”)

DDIFF
This function determines the number of intervals between two dates..

DDIFF(Interval , Date1 , Date2)

PARAMETERS

Interval
Required. String expression that is the interval you want to add. The following table shows the possible values of
the interval parameter.
yyyy = Year
q = Quarter
m = Month
y = Day of year
d = Day
w = Weekday
ww = week of year
h = Hour
mi = Minute
s = Second
Date1
st
The 1 date you want to use.
Date2
nd
The 2 date you want to use in this calculation

Example:
Store the total number of years elapsed between the current date and the date contained in the
textbox with TAG name of BirthDate. Store the value in a textbox with TAG name of AGE.
SETVALUE(~AGE~//DDIFF("yyyy",~BirthDate~,Date()))

187
I T ’ S A S E A S Y A S A - B - C !

DROPID
This function will return the ‘itemdata’ from the specified dropdown boxes currently
selected item.
DROPID(tagname)

PARAMETERS

tagname
The tagname of the dropdown box.

Example:

SETVALUE(~ChosenID~//DROPID(MyDropdown))
EVAL
The function will return the result of a mathematical expression.

EVAL(String)

PARAMETERS

String
The expression to be evaluated.

Example:
Calculate the expression contained in the textbox with TAG name of EXPRESSION, and store
the result in the same textbox.

SETVALUE(~EXPRESSION~//EVAL(~EXPRESSION~))
If EXPRESSION contained the string 1+2+3, the result would be 6.

EXP
This function determines e (the base of natural logarithms) raised to a power.

EXP(Value)

PARAMETERS

Value
Any numeric value

Example:
Display the EXP of the value contained in the textbox with TAG name of EXPRESSION.

MESSAGE(exp(~Expression~)//"TEST")

FILEPICK
This function will open a file dialog allowing the user to select a file. The path of the
selected file is stored in a field in the current table as specified by the field parameter.
(NOTE: FilePick will only display files located in your ‘My Documents’ folder and it’s
subfolders.)

FILEPICK(Description,Pattern)

188
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

Description
The ‘description of the filter to use’ (ie. “All Pictures”)

Pattern
The ‘pattern’ to use (ie. “*.JPG”)

Example:
Display a FILE dialog and store the chosen filepath in the textbox with the tag value PATH. Only
display ‘picture’ files of type JPG.

SETVALUE(~PATH~//FILEPICK(“Show all pictures”,”*.JPG”))

NEWFONT
This function creates and returns a font.
NEWFONT(fontName,fontSize,fontStyle)

PARAMETERS

fontName
String specifiying font name (ie. “Tahoma”)
fontSize
Intgeger specifying font size (ie. “10”)
fontStyle
Ingteger specifying font style (ie. Bold + Italic = “3”)
0=Regular, 1=Bold, 2=Italic, 4=Underline, 8=Strikeout

FORMAT
This function will format the given value into either a CURRENCY or DATE/TIME
format.
FORMAT(Type,Value,DateFormat)

PARAMETERS

Type
CURRENCY = Format value into currency
DATE = Format value into date.
Value
The value to format.
DateFormat
0 = General Date
1 = Long Date
2 = Short Date
3 = Long Time
4 = Short Time
GPSALT
This function will return the current ALTITUDE from your GPS.

189
I T ’ S A S E A S Y A S A - B - C !

GPSALT()

PARAMETERS

NONE

EXAMPLE:

To return the current Altitude of your position and store that value in a memory variable called Altitude:

SETMEM(Altitude //GPSALT())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSALTUNIT
This function will return the current UNITS that your Altitude is calculated in.

GPSALTUNIT()

PARAMETERS

NONE

EXAMPLE:

To return the current Units that your present Altitude is calculated in and store that value in a memory
variable called AltitudeUnits:

SETMEM(AltitudeUnits//GPSALTUNIT())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSDATE
This function will return the current DATE from your GPS.

GPSDATE()

PARAMETERS

NONE

EXAMPLE:

To return the current DATE store that value in a memory variable called DATE:

SETMEM(DATE//GPSDATE())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSLAT
This function will return the current LATITUDE from your GPS.

190
I T ’ S A S E A S Y A S A - B - C !

GPSLAT()

PARAMETERS

NONE

EXAMPLE:

To return the current Latitude of your position and store that value in a memory variable called
LATITUDE:

SETMEM(LATITUDE//GPSLAT())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSLONG
This function will return the current LONGITUDE from your GPS.

GPSLONG()

PARAMETERS

NONE

EXAMPLE:

To return the current Longitude of your position and store that value in a memory variable called
LONGITUDE:

SETMEM(LONGITUDE //GPSLONG())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSMAXALT
This function will return the Maximum altitude you’ve been at since last executing
GPSINIT.
GPSMAXALT()

PARAMETERS

NONE

EXAMPLE:

To return the Maximum Altitude that you’ve traveled at and store that value in a memory variable
called MAXALT:

SETMEM(MAXALT//GPSMAXALT())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSMAXSPEED
This function will return the Maximum speed you’ve traveled at since last executing

191
I T ’ S A S E A S Y A S A - B - C !

GPSINIT. Note that this function returns speed in Knots.


GPSMAXSPEED()

PARAMETERS

NONE

EXAMPLE:

To return the Maximum Speed that you’ve traveled at and store that value in a memory variable called
MAXSPEED:

SETMEM(MAXSPEED//GPSMAXSPEED())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSOK
This function will determine whether your GPS is receiving sufficient satellite data to
return accurate information.
GPSOK()

PARAMETERS

NONE

EXAMPLE:

SETMEM(IsGPSOk//GPSOK())

If your GPS is tracking enough Satellites, GPSOK will return TRUE otherwise it will return FALSE.

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSRAW
This function will return the current GPS Sentence in it’s entirety. An example of a
complete GPS sentence would be this:

$GPRMC,235947.000,A,4250.5589,S,14718.5084,E,0.00,89.68,211200,,*25

GPSRAW()

PARAMETERS

NONE

EXAMPLE:

To display the current GPS sentence in a textbox that has a TAG value of GPS, you could do this:

SETVALUE(~GPS~//GPSRAW())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT

192
I T ’ S A S E A S Y A S A - B - C !

statements for further information on configuring your NMEA GPS device.

GPSSPEED
This function will return your current SPEED from your GPS.
Note that this function returns speed in Knots.
GPSSPEED()

PARAMETERS

NONE

EXAMPLE:

NOTE: 1 Knot = 1.15 Miles Per Hour

To return the current Speed that you’re traveling and store that value in a memory variable called
SPEED:

SETMEM(SPEED//GPSSPEED())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GPSTIME
This function will return the current TIME from your GPS.

GPSTIME()

PARAMETERS

NONE

EXAMPLE:

To return the current GPS Time and store that value in a memory variable called TIME:

SETMEM(TIME//GPSTIME())

*NOTE: This function requires an optional GPS device. Please see the GPSOPEN and GPSINIT
statements for further information on configuring your NMEA GPS device.

GRIDCOL
This function will retrieve the value in the COLUMN of the currently selected GRID
row.

GRIDCOL(Column)

PARAMETERS

Column
The grid column you wish to retrieve the value from. Columns are numbered starting with 0.

EXAMPLE:

To return the value in the FIRST column of a grid containing 4 columns, and store that value in a

193
I T ’ S A S E A S Y A S A - B - C !

memory variable called TEMP:


SETMEM(TEMP//GRIDCOL(0))
To return the value in the LAST column of a grid containing 4 columns, and store that value in a
memory variable called TEMP:
SETMEM(TEMP//GRIDCOL(3))

HOUR
This function will return the HOUR of a given time.

HOUR(Time)
PARAMETERS

Time
The time to return HOUR from.

INPUT
This function will prompt the user to enter a value, and will return the value entered.
INPUT(Prompt,Title,Default)
PARAMETERS

Prompt
The text to prompt the user with

Title
The text to display as a title in the input box.
Default
The default value to display.
INSTR
This function determines the position of the first occurrence of one string within another
string.

INSTR(Start , String1 , String2)

PARAMETERS

start
Optional. Numeric expression that sets the starting position for each search. Must be at least 1.
string1
Required. String expression being searched.
string2
Required. String expression being searched for.

Example:
Display a message if the value contained in TEXTBOX1 is found in TEXTBOX2, otherwise, display a
message saying “NOPE”

TEST(INSTR(1,~text2~,~text1~)//>//0)
MESSAGE("YES! TEXTBOX1 is contained in TEXTBOX2"// ”YES”)
EXIT()

194
I T ’ S A S E A S Y A S A - B - C !

ENDTEST()
MESSAGE(“NOPE”//”NO”)

INT
This function removes the fractional part of a number and returns the resulting integer
value.
INT(number)

PARAMETERS

Number
String expression from which the leftmost characters will be returned

Example:
If ~TEXT1~ contained the value 3.1415927, the following statement would save the value of 3
into ~TEXT2:

SETVALUE(~TEXT2~//INT(~TEXT1~))

KEYCHAR
This function returns the ASC value of the key pressed. Only works from within a
controls KEYPRESS event.
KEYCHAR()

PARAMETERS

NONE

LEN
This function determines the number of characters in a string or the number of bytes
required to store a variable.

LEN(String)

PARAMETERS

String
The string from which to return the length of

Example:
Store the length of the value contained in TEXT1 into a memory variable named LENGTH.

SETMEM(LENGTH//LEN(~text1~))
MESSAGE(<!LENGTH!>//”Length”)

LISTID
This function will return the ‘itemdata’ from the specified listboxes currently selected
item.
LISTID(tagname)

PARAMETERS

tagname
The tagname of the listbox.

195
I T ’ S A S E A S Y A S A - B - C !

Example:

SETVALUE(~ChosenID~//LISTID(MyListbox))
LOOKUP
This function will retrieve a field value from the resulting SQL statement. If multiple
records are returned, LOOKUP will return the 1st value.

LOOKUP(Field , SQL , Server)

PARAMETERS

Field
The field whose value you wish to retrieve
SQL
The SQL statement
Server
The Server used to query against .. use --- for the local device

EXAMPLE:
To retrieve the value of FIELD1 from the table MYTABLE where Field2 = 'TEST' and save that
value in the control referenced by tag ~mytext~:
SETVALUE(~mytext~//LOOKUP({field1},"SELECT * FROM mytable WHERE field2 = 'TEST'","--
-"))

MESSAGEBOX
This function will display a message to the user, and will return a value specifying which
button they tapped.

MESSAGEBOX(Prompt,Buttons,Title)

PARAMETERS

Prompt
The text to display to the user.
Buttons
The following list of values is split into 3 sections. Select one option from each
section, and add up the values. For example, to display the YES, NO, CANCEL buttons
(3) with a QUESTION Icon (32) and have the NO button as the default (256), use
3+32+256 = 291.

SECTION #1 (Number and Type of buttons)


0 = OK Button
1 = OK and Cancel
2 = Abort, Retry, Ignore
3 = Yes, No, Cancel
4 = Yes, No
5 = Retry, Cancel
SECTION #2 (Icon Style)
16 = Critical

196
I T ’ S A S E A S Y A S A - B - C !

32 = Question
48 = Exclamation
64 = Information
SECTION #3 (Default Button)
0 = 1st Button is the default button
256 = 2nd Button is the default button
512 = 3rd Button is default
768 = 4th Button is default

Title
The caption of the messagebox.
VALUE RETURNED:

1 = OK
2 = Cancel
3 = Abort
4 = Retry
5 = Ignore
6 = Yes
7 = No

EXAMPLE:
In the following code, the user will be presented with a message box that prompts them ..
"Do You Want to continue?". They will be given 3 options YES, NO, CANCEL, and
the NO button will be the default.
If they tap NO, the memory variable 'buttonPressed' will contain the value 7.

SETMEM(buttonPressed//MESSAGEBOX("Do You Want to continue?",291,"abcDB"))

MID
This function retains a specified number of characters from a string and removes the
remaining characters.

MID(String , Start , Length)

PARAMETERS

String
The string expression from which the characters will be returned.
Start
Character position in string at which the part to be taken begins
Length
Number of characters to return

EXAMPLE:
Retrieve the 5th through 10th characters of the value contained in TEXT1 and store the result in
TEXT2.
SETVALUE(~TEXT2~//MID(~TEXT1~,5,6))

197
I T ’ S A S E A S Y A S A - B - C !

MINUTE
This function will return the MINUTE of a given time.
MINUTE(Time)
PARAMETERS

Time
The time to return MINUTE from.
MONTH
This function determines the month from a specified date, and returns a number from 1
to 12.

MONTH(Date)

PARAMETERS

DATE
Any date.

Example:
To return the month from the date contained in a textbox with TAG name of InvoiceDate:
MESSAGE(MONTH(~InvoiceDate~)//”Month”)

MONTHNAME
This function will return the name of the MONTH of a given date.
MONTHNAME(Date)
PARAMETERS

Date
The date to return MONTHNAME from.
NEXTID
This function returns the next value for a field. If the field/table specified HAS NOT had
an 'ID INCREMENT' value initialized, NEXTID will return the next highest value
contained in the field.
NEXTID(Field , Table)

PARAMETERS

Field
The FIELD you wish to retrieve the next id for.
Table
The TABLE the field is contained in.

Example:
To automatically save the next valid ID value into the ID field on your current form whenever a
new record is added, place the following code in your forms ON ADD event. (note: Assumes
your ID field is bound to a textbox with tag value of IDFIELD, and that your FORM is bound to a
table named MyTable.)
SETVALUE(~IDFIELD~//NEXTID(ID,MyTable))

198
I T ’ S A S E A S Y A S A - B - C !

OUTLOOKCOUNT
This function returns the # of items in the specified outlook collection.
OUTLOOKCOUNT(collection)

PARAMETERS

Collection
1= Contacts
2=Calendar
3=Tasks

OUTLOOKFIND
This statement will find an item in the selected collection based on the specified
restriction. If item is found, returns 1. If no item found, returns 0.
OUTLOOKFIND(collection,Field,Operator,Value)

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task

Field
Name of outlook field to search.

Operator
The operator of an expression (ie. In the expression FIELD1 <> FIELD2, <> is the operator.

= Equality
< Less than
> Greather than
<= Less than or equal to
>= Greater than or equal to
<> Not equal

Restriction
String which defines which items to find. The string must contain a Boolean expression that evalues to true or
false for any item. Enclose fieldnames between brackets ie. [FieldName].
You can combine expressions with AND and OR. Comparison operators are the following:
<, <=, >=, >, =, or <>.
For example, the restriction string [CompanyName] = ‘Microsoft’ returns the first item that has Microsoft as the
company
See Appendix L for a list of available field names.

Value
The value to search for

Example:
To find the first contact with [CompanyName] = ‘Microsoft’, you would use this syntax:

Setmem(Find//OUTLOOKFIND(1,”[CompanyName]”,”=”,”Microsoft”))
TEST(<!FIND!>//=//0)
MESSAGE(“Not found”//”abcdb”)
Else()
MESSAGE(“success!!!”//”ABCDB”)
ENDTEST()

OUTLOOKFINDNEXT
This statement will find the next item in the selected collection based on the most
recently executed OUTLOOKFIND restriction. Returns 1 if found, 0 if not found.
OUTLOOKFINDNEXT(collection)

199
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

Collection
1 = Contacts
2 = Calendar
3 = Task
REGGETINT
This function returns the integer value in the specified registry key.
REGGETINT(section,key)

PARAMETERS

Section
String specifiying section name (ie. “\Software\abcDB\User\”)
Key
String specifiying key name (ie. “MyKey”)

REGGETSTR
This function returns the string value in the specified registry key.
REGGETSTR(section,key)

PARAMETERS

Section
String specifiying section name (ie. “\Software\abcDB\User\”)
Key
String specifiying key name (ie. “MyKey”)

RANDOM
This function returns a random number.
RANDOM(LowerLimit , UpperLimit)

PARAMETERS

LowerLimit
The lowest number you want returned
UpperLimit
The highest number you want returned

Example:
To create a random number between 100 and 200, and save that value into the textbox with the
TAG value of RANDOM:
SETVALUE(~RANDOM~//RANDOM(100,200))

RECCOUNT
This function will return the current record count.

RECCOUNT(SUBFORM)

PARAMETERS

Subform
0 or blank = Main Form Datasource
1 = Subform#1
2 = Subform#2
3 = Subform#3
4 = Subform#4
5 = Subform#5.

200
I T ’ S A S E A S Y A S A - B - C !

Example:
To automatically display the total number of records every time you move to a new record, enter
the following code in your forms ON CURRENT event. (Note: Assumes you have a TEXTBOX
with a tag name of TOTALRECORDS)
SETVALUE(~TOTALRECORDS~//RECCOUNT(0))

RECNO
This function will return the current record position.

RECNO()

PARAMETERS

NONE

Example:
To automatically display your record position every time you move to a new record, enter the
following code in your forms ON CURRENT event. (Note: Assumes you have a TEXTBOX with a
tag name of POS)
SETVALUE(~POS~//RECNO())

REPLACE
This function replaces a specified substring with another specified substring.

REPLACE(Sring , Find, Replace)

PARAMETERS

String
The original string that contains characters you want to replace
Find
The ‘substring’ that is contained in STRING that you want to replace.
Replace
The string which will replace the FIND string.

Example:
To replace all references of SALLY to JOHN in the following sentence, and then save the
resulting sentence in the textbox with TAG value of MODIFIED:

SETVALUE(~MODIFIED~//REPLACE(“Sally wants what Sally gets”,”Sally”,”John”))

RIGHT
This function retains the specified number of characters on the right side of a string and
removes the remaining characters on the left side of the string.

RIGHT(String , Length)

PARAMETERS

String
String expression from which the rightmost characters are returned
Length

201
I T ’ S A S E A S Y A S A - B - C !

Numeric expression that indicates how many characters to return

Example:
Store the last 10 characters of the value contained in TEXT1 in TEXT2.

SETVALUE(~TEXT2~//RIGHT(~TEXT1~,10))

RNDID
This function returns a RANDOM integer value useful for use in ID Random field types.

RNDID()

PARAMETERS

NONE

Example:
To automatically save the a valid Random ID value into the ID field on your current form
whenever a new record is added, place the following code in your forms ON ADD event. (note:
Assumes your ID field is bound to a textbox with tag value of IDFIELD)
SETVALUE(~IDFIELD~//RNDID())

ROUND
This function rounds a number to the nearest integer.

ROUND(Number)

PARAMETERS

Number
The number to be ‘rounded’

Example:
Round the value contained in TEXT1, and store the result in a memory variable named
ROUNDED.
SETMEM(ROUNDED//ROUND(~TEXT1~))
MESSAGE(<!ROUNDED!>//”ROUNDED VALUE”)

SECOND
This function will return the SECONDS portion of the given time.

SECOND(Time)
PARAMETERS

TIME

The time to return SECONDS from.


SIN
This function determines the sine of an angle.

SIN(Angle)

202
I T ’ S A S E A S Y A S A - B - C !

PARAMETERS

Angle
The value from which you want to return the SIN

Example:
Display the SIN of the value contained in TEXT1
MESSAGE(SIN(~text1~)//”SIN Value”)

SQR
This function determines the square root of a number.

SQR(Number)

PARAMETERS

Number
The number from which to return the square root.

Example:
Display the Square root of the value contained in TEXT1
MESSAGE(SQR(~text1~)//”Square Root”)

TAN
This function determines the TAN of a number.

TAN(Number)

PARAMETERS

Number
The number from which to return the tangent.

Example:
Display the tangent of the value contained in TEXT1
MESSAGE(TAN(~text1~)//”Tangent”)

TAVG
This function will retrieve the AVG of numeric records retrieved by the SQL statement.

TAVG(Field , SQL , Server)

PARAMETERS

Field
The field you wish to find the average of.
SQL
The SQL statement which determines which records to average.
Server
The Server used to query against .. use --- for the local device

Example:
Save the average of FIELD1 into the textbox with tag name of MYTEXT.

203
I T ’ S A S E A S Y A S A - B - C !

SETVALUE(~mytext~//TAVG({field1},"SELECT field1 FROM mytable","---"))

TCOUNT
This function will retrieve the COUNT of records retrieved by the SQL statement.

TCOUNT(SQL , Server)

PARAMETERS

SQL
The SQL statement which determines which records to count.
Server
The Server used to query against .. use --- for the local device

Example:
Count how many customers live in the city of Toronto, and store the number in a memory
variable named TORONTOCUSTOMERS
SETMEM(TORONTOCUSTOMERS//TCOUNT(“SELECT * FROM MyCustomers WHERE City =
‘Toronto’”,”---“))
MESSAGE(“There are “ <!TORONTOCUSTOMERS!> “ in Toronto”//”Total”)

TID
This function will retrieve the next highest field value.

TID(Field , SQL , Server)

PARAMETERS

Field
The Field you wish to retrieve the next highest value from. (Note: Must be an integer field)
SQL
The SQL statement which determines which records to count.
Server
The Server used to query against .. use --- for the local device

Example:
Return the next highest value in the ID field, and store it in the ID field of every newly created
record. Add the following code to your forms ON ADD event.
SETVALUE(~ID~//TID(“ID”,”SELECT ID FROM MyTable”,”---“))

It is usually better to use the NEXTID function. TID will only return the next
highest value. Thus if the last record of a table is deleted, and TID is performed
again, a duplicate value will be generated. NEXTID does not permit multiple uses of
the same value.

TIME
This function retrieves the current system time.

TIME()

PARAMETERS

204
I T ’ S A S E A S Y A S A - B - C !

NONE

Example:
To place a timestamp on every newly added record, add the following code to the forms ON ADD
event (Note: Assumes a DATE/TIME field named TIMESTAMP is bound to a textbox with a tag name
of TIME2.

SETVALUE(~TIME2~//TIME())

TMAX
This function will retrieve the MAXIMUM of numeric records retrieved by the SQL
statement.

TMAX(Field , SQL , Server)

PARAMETERS

Field
The field you wish to find the maximum value of. (Must be an INTEGER field)
SQL
The SQL statement which determines which records to find the max of.
Server
The Server used to query against .. use --- for the local device

Example:
Save the maximum value of FIELD1 into the textbox with tag name of MYTEXT.
SETVALUE(~mytext~//TMAX(“field1”,"SELECT field1 FROM mytable","---"))

TMIN
This function will retrieve the MINIMUM value of numeric records retrieved by the
SQL statement.

TMAX(Field , SQL , Server)

PARAMETERS

Field
The field you wish to find the minimum value of. (Must be an INTEGER field)
SQL
The SQL statement which determines which records to find the minimum of.
Server
The Server used to query against .. use --- for the local device

Example:
Save the minimum value of FIELD1 into the textbox with tag name of MYTEXT.
SETVALUE(~mytext~//TMIN(“field1”,"SELECT field1 FROM mytable","---"))

TSUM
This function will retrieve the SUM of the fields retrieved by the SQL statement.

TSUM(Field , SQL , Server)

PARAMETERS

205
I T ’ S A S E A S Y A S A - B - C !

Field
The field you wish to find the sum of. (Must be an INTEGER field)
SQL
The SQL statement which determines which records to find the sum of.
Server
The Server used to query against .. use --- for the local device

Example:
Save the sum value of FIELD1 into the textbox with tag name of MYTEXT.
SETVALUE(~mytext~//TSUM({field1},"SELECT field1 FROM mytable","---"))

WEEKDAY
The function returns the weekday number of the date given.
Returns:
Sunday – 1
Monday – 2
Tuesday – 3
Wednesday – 4
Thursday – 5
Friday – 6
Saturday – 7

WEEKDAY(Date)

PARAMETERS

DATE
Any date.

Example:
To return the ‘weekday’ from the date contained in a textbox with TAG name of InvoiceDate:

TEST(WEEKDAY(~InvoiceDate~)//=//7)
MESSAGE(“This invoice was on a Saturday!”//”Test”)
EXIT()
ENDTEST()

TEST(WEEKDAY(~InvoiceDate~)//=//1)
MESSAGE(“This invoice was on a Sunday!”//”Test”)
EXIT()
ENDTEST()

MESSAGE(“This invoice was on a weekday!”//”test”)

WEEKDAYNAME
This function will return the WEEKDAYNAME of the given date:

WEEKDAYNAME(date)
PARAMETERS

Date

206
I T ’ S A S E A S Y A S A - B - C !

The date value


RETURNS:
EXAMPLE

In the following statement, the memory variable DAYNAME will be filled with the
FRIDAY since October 3, 2002 was a FRIDAY.
SETMEM(DAYNAME//WEEKDAYNAME("10/03/2002"))
YEAR
This function determines the year from a specified date, and returns an integer.

YEAR(Date)

PARAMETERS

DATE
Any date.

Example:
To return the year from the date contained in a textbox with TAG name of InvoiceDate:
MESSAGE(YEAR(~InvoiceDate~)//”Year”)

WEBSERVICE
This function queries the remote webservice that you have specified (see Appendix M
for more info)
WEBSERVICE(Function,URL,Param1,Param2,Param3,Param4,Param5)

PARAMETERS

Function
The function you wish to call. Must be a number from 1-13
URL
The URL of your webservice (ie. www.YourServer.com/service1.smpx
Param1-5
Optional values you wish to submit to the webservice.

Example:
The following abcDB code sample would query the FUNCTION1 method on your
server for the current account balance of the customer whose customer ID is
"CUST22". Assuming you've implemented the necessary code/logic in FUNCTION1,
abcDB should receive the balance back in the form of a string value (ie. "$945.22")

SETMEM(CustBalance//WEBSERVICE(1,"www.YourServer.com/service1.smpx","CUST22","","","",""))

207
I T ’ S A S E A S Y A S A - B - C !

F
Appendix

Appendix F – All about PRIMARY


KEY Indexes and Ensuring your
MS Access tables will
‘Synchronize’
PRIMARY KEYS are the way that relational databases are able to quickly find and bring
together the data that is found in separate tables.
In Microsoft Access, when a field in a table is defined as a PRIMARY KEY, it means that
Access will not allow any new records to contain duplicate PRIMARY KEY values.
For example, consider the following two tables:

TABLE NAME FieldName FieldType

CUSTOMERS ID AutoNumber (PRIMARY


KEY)
FirstName TEXT
LastName TEXT

TABLE NAME FieldName FieldType

INVOICES ID AutoNumber (PRIMARY


KEY)

CustomerID NUMBER
InvoiceNumber NUMBER
InvoiceDate DATE/TIME

208
I T ’ S A S E A S Y A S A - B - C !

InvoiceAmount CURRENCY

Note that each table contains a PRIMARY KEY field named ID. This means that whenever a
new record is added to either table, a new value is automatically generated and saved to this
field. Access will ensure that no two fields will ever contain the same ID value.

This is all GREAT! But now for the problem. The Microsoft PocketPC Database Engine does
not support AutoNumber fields. Which means that when you import your tables from your
desktop computer to your PocketPC, any AutoNumber fields will be converted to normal
INTEGER fields.
So why is this a problem? Very simply because if you add a new record using abcDB, your ID
fields will not be given a value! They would be left blank. And in order for synchronization to
work, ALL your newly added records must contain valid ‘unique’ PrimaryKey values.
So how can we ensure that our data synchronization will be successful?

All is not lost! abcDB now contains the ability to generate the equivalent of AutoNumber
values. How? Well, let’s take a quick look. First of all, we’re going to review the steps
necessary to create PRIMARY KEY indexes from within MS Access. Then we’ll move to the
PocketPC.

F.1 CREATING PRIMARY KEY INDEXES IN MICROSOFT ACCESS


First, either open an existing database
OR create a new database in Microsoft
Access. Once you have completed this,
click on the TABLES tab:

Here we are on the TABLE tab of MS


Access. In order to create our new table,
let’s click the CREATE A TABLE IN
DESIGN VIEW button.

NOTE: Depending on the version of MS


Access you're using, the following
screenshots may appear slightly different.

209
I T ’ S A S E A S Y A S A - B - C !

Now we see the table designer. Notice


how we’ve already added the necessary
fields to our table. They include:

Firstname, Lastname, Address, City, State,


Zip, Country

But for now we’re going to focus on the


first field we added … the ID field.
Notice we’ve set it to be an
AUTONUMBER field.

This means that whenever a new record


is added to this table, that new record
will be assigned a new ‘unique’ number.

But more is required before we’re


finished. Let’s ‘right-click’ on the ID
field, and move to the next step.

Depending on the version of MS Access


you are running, you should see a menu
similar to the one shown here. Notice
that the first option is called PRIMARY
KEY.

Let’s select the PRIMARY KEY, and move


to the next step.

210
I T ’ S A S E A S Y A S A - B - C !

Notice that immediately to the left of our


ID field, there is a tiny KEY symbol ( ).
This indicates that our ID field is now a
PRIMARY KEY index field. In other
words, EVERY record will be guaranteed
to have a unique number. No duplicate
ID numbers will be allowed.

This is the key to making


‘synchronization’ work between your
PocketPC and your desktop computer.

For the purpose of this tutorial, we’ll


close this screen, and save the table
using the name of CUSTOMERS.

If you need to modify an ‘existing’ table


to ensure it contains a PRIMARYKEY
index, you can do so by selecting it in
the list of tables and clicking the
DESIGN button. You’ll then be
presented with a similar screen to the
one that you saw in the previous step,
where you can modify and/or add the
necessary PRIMARYKEY.

Let’s OPEN our newly created Customers


table, and we’ll add a couple of new
records.

211
I T ’ S A S E A S Y A S A - B - C !

See how AutoNumbering works?


Everytime we added a new record, our
PRIMARY KEY field (our ID field) was
given a unique value. Here we have ID
values of 1 and 2.

Now let’s ‘import’ this table to our


PocketPC. If you need to ‘brush up’ on
how to import tables, review section 3.2.

Here we are in abcDB. We’ve already


opened our database, and as you can
see, our Customers table is in the list.
Let’s open it to make sure that our two
newly added records are present.

212
I T ’ S A S E A S Y A S A - B - C !

And VOILA! There they are!

Now we’ll see what happens when we


try adding a new record. Let’s do that
now by tapping the menu button.

Notice that our ID field is left blank,


unlike in MS Access where it was
automatically filled with the next highest
number!

Oh well, let’s save this record anyway.

213
I T ’ S A S E A S Y A S A - B - C !

Our record was saved ok. So what’s the


problem?

Well, let’s try ‘synchronizing’ with our


desktop, and we’ll see what the problem
is.

(Note: To synchronize, make sure your


PocketPC is cradled, and then tap the
SYNC button from within ActiveSync.
Make sure you have exited abcDB
AND MS Access before
synchronizing, otherwise results
may not be as expected.)

When we open up the table again in MS


Access, we don’t see JOHN DOE’s
record. Why not?

Because it did not contain a valid value


in it’s PRIMARY KEY ID field.

Before we go back to our PocketPC, let’s


add another new record here.

Add Sally Smith, and then SYNC your


PocketPC again.

214
I T ’ S A S E A S Y A S A - B - C !

There! Our Sally Smith record came


back to our PocketPC just fine. Again,
it’s because it contained a valid value in
it’s ID field.

Now let’s see how we can ensure that


abcDB mimics this ability to provide
values for PRIMARY KEY fields.

Move back to the TABLES tab in abcDB,


select our Customers table, and then tap
EDIT.

In order to have abcDB automatically


insert values into our ID field, we need
to change the ID field to type ID
INCREMENT.

Let’s do that now.

1. Select the ID field from the list.

2. Tap the EDIT button.

3. Change the field TYPE to ID


INCREMENT

4. Tap the SAVE button that is to


the left of the EDIT button.

Move to the next step…

215
I T ’ S A S E A S Y A S A - B - C !

We now need to enter a starting


number. abcDB will start numbering
newly added records with this
number+1.

1. Let’s enter 100000 and tap OK.

2. Tap SAVE at the top of the screen

3. OPEN our customers table, and


add another new record

See! Now abcDB has automatically


entered the number 100001 in our ID
field.

Let’s SAVE this record, and try syncing


again.

216
I T ’ S A S E A S Y A S A - B - C !

COOL! Our MS Access database now


contains the record we just added on
our PocketPC. Are you starting to see
how powerful this can be?

And again, the KEY to all of this is


maintaining valid UNIQUE values in our
PRIMARY KEY fields.

So this is the answer to ALL our


problems right?

Not quite.

What happens if someone on our


desktop computer were to add a new
record now?

Let’s see …

See what MS Access has done? It’s used


100002 as it’s next number!

SO what happens then if a user on the


desktop computer and a user in abcDB
both add new records? They’ll both end
up with the same ID number! And
remember, in order for synchronization
to work, all new records must contain
UNIQUE values!

But you may be thinking that in your


particular scenario, no one will ever be
adding new records on your desktop
computer. The only people to add new
records are the people with abcDB on
their PocketPC’s.

But this presents it’s own unique


problem.

Here's what will happen if you have


multiple abcDB users:

1. You 'synchronize' your PocketPC(s)


in the morning.

2. You enter a new record. Assume


the ID INCREMENT value = 1500

217
I T ’ S A S E A S Y A S A - B - C !

3. If you have more than one user,


assume that PocketPC User #2 enters a
new record. He'll get the same
AutoNum (assuming that his ID
INCREMENT seed value was set the
same)

4. PocketPC #3 enters a new record.


He'll also get an AutoNum of 1500

5. This will happen all throughout the


day.

6. When all four users come back to


'synchronize' all the data will be
wrong. ActiveSync will correctly insert
the first users newly added record with
Autonum of 1500. Thereafter, when
the other 3 users sync, ActiveSync will
think that their records are 'changed'
records rather than 'new' records,
because the AutoNum of 1500 already
exists in the master database. Clear as
mud?

7.This is also assuming that no one in


the office has edited this same table
and added a new record. If so, then
Autonum 1500 will already exists
before ANY of the remote users try to
sync, and thus ALL the remote users
data will simply 'update' the existing
Autonum 1500 rather than 'add' new
records.

So what can possible be done to remedy


this problem?

Let’s create a new table in our MS Access


database. Let’s make it exactly the same
structure as before, but this time, let’s
make our ID field a TEXT field 50
characters wide. Remember to make it a
PRIMARY KEY.

Name this new table NewCustomers and


re-import this database to your

218
I T ’ S A S E A S Y A S A - B - C !

PocketPC.

Ok, here we are again in abcDB. We


can see both our tables now.

If we were to OPEN our


NEWCUSTOMERS table and add a new
record, we’d be faced with the same
problem as before. Either manually
enter a valid unique value, OR our
synchronization will fail.

So let’s edit this table, and we’re going to


EDIT our NewCustomers table and
change our ID field to field type ID
GUID.

Once you’ve completed this, move to


the next step.

Now, when we ADD a new record, see


what happens?

abcDB has automatically inserted a


GUID (Globally Unique ID) into our ID
field.

NOTE: If you are adding data via a


FORM, you will need to manually create
the GUID by using the AUTOID()
statement.

Let’s SAVE this record, exit abcDB and


MS Access, and synchronize.

Move to next step…

And there we have it! Our newly added


record is now in our desktop database!

Do you see the advantage of using


GUID’s when you’re in a ‘disconnected’
environment?

Now, you can have UNLIMITED


PocketPC’s running abcDB, each adding

219
I T ’ S A S E A S Y A S A - B - C !

new records … each being provided


with a unique GUID. Upon
synchronizing, all new records should
sync back to the desktop with no
problems.

There is still one problem though. What


happens if we wish to add new records
on our Desktop database? Because
we’ve modified the field to be a simple
TEXT field, MS Access will no longer
create the necessary value automatically.

We can however manually create a


GUID using the code found below.

1. Copy the code below to a new


module in your Access database

2. Simply call the GetGUID()


function whenever you add a
new record, and store the
resulting value in your
PrimaryKey field.

220
I T ’ S A S E A S Y A S A - B - C !

MS Access GUID Generator (This code was obtained from an anonymous source on the internet. As such,
you are cautioned to make sure this code will work as expected. PocketSOFT.ca makes no guarantees)
Private Type GUID

Data1 As Long

Data2 As Integer

Data3 As Integer

Data4(7) As Byte

End Type

Private Declare Function CoCreateGuid Lib "OLE32.DLL" (pGuid As GUID) As Long

Public Function GetGUID() As String

'(c) 2000 Gus Molina

Dim udtGUID As GUID

If (CoCreateGuid(udtGUID) = 0) Then

GetGUID = _

String(8 - Len(Hex$(udtGUID.Data1)), "0") & Hex$(udtGUID.Data1) & _

String(4 - Len(Hex$(udtGUID.Data2)), "0") & Hex$(udtGUID.Data2) & _

String(4 - Len(Hex$(udtGUID.Data3)), "0") & Hex$(udtGUID.Data3) & _

IIf((udtGUID.Data4(0) < &H10), "0", "") & Hex$(udtGUID.Data4(0)) & _

IIf((udtGUID.Data4(1) < &H10), "0", "") & Hex$(udtGUID.Data4(1)) & _

IIf((udtGUID.Data4(2) < &H10), "0", "") & Hex$(udtGUID.Data4(2)) & _

IIf((udtGUID.Data4(3) < &H10), "0", "") & Hex$(udtGUID.Data4(3)) & _

IIf((udtGUID.Data4(4) < &H10), "0", "") & Hex$(udtGUID.Data4(4)) & _

IIf((udtGUID.Data4(5) < &H10), "0", "") & Hex$(udtGUID.Data4(5)) & _

IIf((udtGUID.Data4(6) < &H10), "0", "") & Hex$(udtGUID.Data4(6)) & _

221
I T ’ S A S E A S Y A S A - B - C !

IIf((udtGUID.Data4(7) < &H10), "0", "") & Hex$(udtGUID.Data4(7))

End If

End Function

222
I T ’ S A S E A S Y A S A - B - C !

G
Appendix

Appendix G – Installing the


abcDB™ ‘Wireless’ Server

NOTE: This Appendix only applies to the abcDB™ ‘Wireless’ version.

This web page assumes you have successfully installed the 'client' portion of abcDB™
Wireless to your device.

WHAT DOES THE abcDB™ APPLICATION SERVER DO?


The main component of the Application Server Software is a program you run on a
centrally-located computer. This program is called the Application Server.

Its job is to listen for requests coming in over the Internet from applications being
run on the computers of distant remote and mobile users (called "Clients"), and to
respond to those requests, typically by interacting with a database. The Application
Server sends requests to the database, receives back responses, and passes responses
and data information back to the Clients.

The process is:

Remote users > Internet > abcDB™-dbBridge Application Server > Databases

CAN I IMMEDIATELY USE THE APPLICATION SERVER?


Not quite. You need:

1. A connection to the Internet.


2. A connector to your database.
3. To have the dbBridge abcDB™ Application Server running.

You first need to ensure you have a connection to the Internet (or your LAN, intranet

223
I T ’ S A S E A S Y A S A - B - C !

or WAN), and connection to the database. That requires a setting and a database
engine.

The Application Server usually resides on the same centrally-located computer as


your database. For the Application Server to communicate with that database, it
requires a database engine.

The Application Server's primary function is to act as a coordinator between abcDB™


Database (located on your PocketPC) and a centrally-located database, conveying data
requests and responses to and from a database. Unless it has a database to
communicate with, the Application Server cannot provide any interaction with a
database.

There are steps required to ensure that various components are in place, before
running the Server Software. These include:

1. Ensuring there is a connection to the Internet from the computer running the
Application Server. Typically, this is a permanent connection, usually through a high-
speed connection line, like a T1, T3, Cable Modem, or DSL line. However, it could be a
low-speed phone modem, if you can arrange to have it available when Clients need
access and if you have a means to tell the Clients the IP address of that phone
modem.

2. Ensuring there is a connection specified for the database(s) that are to be used.

You will build a connection string during startup. You will need to ensure you have
the necessary access to the appropriate database, whether direct, or through OLEDB
or ODBC.

CAN I IMMEDIATELY USE THE APPLICATION SERVER?


Not quite. You need:

1. A connection to the Internet.


2. A connector to your database.
3. To have the dbBridge abcDB™ Application Server running.

You first need to ensure you have a connection to the Internet (or your LAN, intranet
or WAN), and connection to the database. That requires a setting and a database
engine.

The Application Server usually resides on the same centrally-located computer as


your database. For the Application Server to communicate with that database, it
requires a database engine.

The Application Server's primary function is to act as a coordinator between abcDB™


Database (located on your PocketPC) and a centrally-located database, conveying data
requests and responses to and from a database. Unless it has a database to
communicate with, the Application Server cannot provide any interaction with a

224
I T ’ S A S E A S Y A S A - B - C !

database.

There are steps required to ensure that various components are in place, before
running the Server Software. These include:

1. Ensuring there is a connection to the Internet from the computer running the
Application Server. Typically, this is a permanent connection, usually through a high-
speed connection line, like a T1, T3, Cable Modem, or DSL line. However, it could be a
low-speed phone modem, if you can arrange to have it available when Clients need
access and if you have a means to tell the Clients the IP address of that phone
modem.

2. Ensuring there is a connection specified for the database(s) that are to be used.

You will build a connection string during startup. You will need to ensure you have
the necessary access to the appropriate database, whether direct, or through OLEDB
or ODBC.

HOW DO I CONNECT THE APPLICATION SERVER TO THE


INTERNET?
If the computer designated to contain the abcDB™-dbBridge Application Server
Software does not have a permanent connection to the Internet, contact an ISP
(Internet Service Provider) and arrange such a connection, ensuring that you receive
a STATIC IP address. There are many types of connections that you can arrange with
the ISP, including:

1. Phone modem running full-time, or part-time.


2. ISDN
3. Cable modem
4. Phone DSL
5. High speed T1 lines

and others.

The ISP, when setting up your Internet connection, will provide you with an IP
(Internet Protocol) address (like 125.36.456.2) that is required by Clients.

You want to ensure that the IP address is permanent (STATIC), since abcDB™
Database will be relying on that address when trying to connect with the dbBridge
abcDB™ Application Server. If you use a phone modem or cable or DSL connection,
the ISP may be providing a temporary IP address that changes every time you
connect the central computer to the Internet.

Since abcDB™ Database will need to know the IP (Internet Protocol) address of the
computer running the Application Server, temporary phone modem connections or
any connection that does not provide a permanent connection is not a convenient
way to work with abcDB™ Wireless.

225
I T ’ S A S E A S Y A S A - B - C !

However, if your needs for remote connectivity are minimal and if you have a way to
communicate the temporary IP address to abcDB™ Database, it may be suitable.

HOW DO I RUN THE APPLICATION SERVER SOFTWARE?


The steps are:

I. Connect to the Internet.


II. Provide a connector to the database.
III. Run the dbBridge ADO Application Server.

I. Connect to the Internet.

Ensure there is an active connection to the Internet. Since abcDB™ Database could be
connecting to the Application Server 24 hours a day, you need a permanent
connection. Talk to your ISP about providing same in one of the previously-
mentioned forms referenced in C. above.

Examine your Networking configuration to review your connectivity settings. Click


[Start] > Settings > Control Panel > Network and review the TCP/IP Protocol
installation.

226
I T ’ S A S E A S Y A S A - B - C !

The Network Configuration should include a TCP/IP Protocol setting for the network
interface card connected to the Internet.

II. Provide a connector to the database.

Ensure there is a connection to your database as an ODBC Data Source Name.

III. Run the dbBridge abcDB™ ADO Application Server.

Using the dbBridge abcDB™ ADO Server


a. Ensure MDAC is installed. When you run the Server, you will be given the
opportunity then to create a connection string. You will need to have previously
established any required OLEDB or ODBC settings, if you are using those options.
Otherwise, you will

You will need to set up an ODBC Data Source Name for use with the dbBridge
abcDB™ ADO Server, either as an ODBC Data Source Name or, a database connection
that is available.

b. Run dbBridgeADOServer_AbcDB™.exe. A login will display. This is to obtain an

227
I T ’ S A S E A S Y A S A - B - C !

administrative username and password that gives full rights for database access.

c. After clicking [OK], the Connection String builder dialog will display:

d. Typically, you would click [Build] to create the database connection string and
build similar to the following dialogs:

228
I T ’ S A S E A S Y A S A - B - C !

229
I T ’ S A S E A S Y A S A - B - C !

e. After completing the connection string build and clicking [OK], the login will
proceed normally and result in the Application Server being displayed.

Provided the properties under the [Settings] tab are correctly set, the Application Server should
be able to run unattended. See the next section: E. WHAT ARE THE SETTINGS IN THE
APPLICATION SERVER? for more information on those properties.

WHAT ARE THE SETTINGS IN THE APPLICATION SERVER?


Once the Application Server is running, certain properties may need to be set,
depending on the type of database that is connected. Those properties are located
under the [Settings] tab and are of two types:

1. Server settings. Various settings that affect how SQL expressions are processed.
2. Client settings. Settings passed to the abcDB™ PocketPC client when it logs in.

You may need to experiment with the settings, although we recommend you start
with the default settings and modify them only if you experience problems.

See H. APPLICATION SERVER SETTINGS DETAILS below for more details.

230
I T ’ S A S E A S Y A S A - B - C !

WHAT ARE SOME SPECIAL CONSIDERATIONS (FIREWALL,


ENCRYPTION, ETC.)?
Firewalls:

The dbBridge abcDB™ Application Server is designed to work behind a firewall,


provided you have the dbBridge abcDB™ Redirector application. There are two main
ways to configure the Application Server when a firewall is in place:

1. Open a Port on the firewall that matches the Port designated by the Application
Server.
2. Use the dbBridge Redirector application to allow inbound, cloaked HTTP requests
through Port 80 and on to the Application Server. (Contact support@PocketSOFT.ca
for more information on the redirector application.)

Option 1 is the preferred option. If Option 2. is chosen, there will be a slowdown in


processing, since another application layer will become part of the chain of events.
The process becomes:

Remote users (abcDB™ Clients) >>>> Internet > Firewall > dbBridge abcDB™
Redirector > Application Server > Database engine > Database

Firewalls at the remote users' Client locations have a similar affect. If the firewall
allows requests out of the applicable port, there is no affect on the process, except
that, of course, the firewall is another layer in the event chain. However, if the
firewall restricts requests and responses, the remote user will have to turn on HTTP
Cloaking in order to send requests and receive responses.

APPLICATION SERVER SETTINGS DETAILS.


There are two main sets of settings under the [Settings] tab: Server settings and Client
settings.

231
I T ’ S A S E A S Y A S A - B - C !

1. Server settings

Server settings are properties used by the dbBridge abcDB™ Application Server when
processing requests.

a. Display [Default: true] - turn the display on/off

b. Intercept [Default: false] - intercept requests.

This results in every request being displayed in a dialog box so that you can evaluate
and debug specific problems. Don't use this in a production setting; only use it when
debugging.

c. Use transactions [Default: true] - place updates, inserts, deletes inside transactions.

Deselect this option if the database you are connecting to does not support
transactions.

d. Remove IS NULL [Default: true] - remove SELECT expressions containing WHERE


definitions that include IS NULL values.

dbBridge Client applications do not determine if a value is blank or NULL. To


dbBridge, both are the same. Therefore expressions may be transmitted that contain

232
I T ’ S A S E A S Y A S A - B - C !

WHERE clauses interpreted as NULL instead of blank. Selecting the Remove IS NULL
option prevents this.

e. Limit SELECT * (1) [Default: true] - dbBridge reserves a setting of 1 in MaxRecords.

If this option is selected, statements containing SELECT * FROM having a MaxRecords


setting of 1 will always be assumed to be metadata, not data, requests.

f. Enable GetNext Packet [Default: true] - allows packet segmentation.

Leave selected unless you wish to prevent subsequent requests for next packet
segments.

g. Strip table owner prepend [Default: true] - some databases do not accept table
specifications that include the owner (as in "dbo.customers").

Most databases default to a stripped prepend.

h. Use threads [Default: false] - if not selected, requests are queued and processed
sequentially.

If selected, requests are threaded and each request runs in its own memory area.
Restrict the maximum number of active threads via the Max pooled threads.

i. Max pooled threads [Default: 0] - if Use threads is selected, this specifies the
maximum number of threads that will be running at any one time.

Threads require memory and you should experiment with the settings to find the
optimum level. Max pooled threads must be greater than zero to be usable.

j. This space intentionally left blank.

k. Allow COUNT [Default: true] - if not selected, SELECT statements containing the
COUNT clause will be returned empty.

Some databases do not allow COUNT and will reject SELECT statement containing the
COUNT clause.

l. Allow UPPER [Default: true] - if not selected, SELECT statements containing the
UPPER clause will be returned empty.

Some databases do not allow UPPER and will reject SELECT statement containing the
UPPER clause.

2. Client settings

These settings are passed to the Client on login and affect how requests are
structured. When in doubt, use the default setting.

233
I T ’ S A S E A S Y A S A - B - C !

a. Allow Null [Default: true] - if selected, blank fields will be assumed to be NULL.

b. Blobs As Params [Default: false] - if selected, blob fields updates will be passed
from the Client as separate parameters. Several databases require this as opposed to
embedding the blob update information in the SQL UPDATE (or INSERT) statement.

c. Quote Date Fields [Default: false] - if selected, a single quote mark will be placed
around all date field values.

Defaults to a single quote; overridden by Quote char.

d. Need exec prepared [Default: true] - PREPARE EXECSQL type requests. Required by
most database actions.

e. Log date format [Default: NUMBER] - specify the format for date values.

Use NUMBER wherever possible, since it's the most cross-compatible approach. Using
NUMBER causes dates to be transmitted as float values instead of string structures.

f. Quote char [Default: single quote] - specify the quote char to be used with date
fields.

g. DBMS name [Default: DBBRIDGE] - if required, select or enter a database name to


be used by the Client.

Some databases may require a specific value.

h. Max records [Default: 0] - control the maximum number of records that will be
sent to a Client before first warning the Client.

i. Max file size [Default: 0] - control the maximum file size of outbound data packets
before first warning the Client.

Max records and Max file size enable you to ensure that large data packets are not
sent unnecessarily to Clients. Occasionally, Clients may make requests that could take
significant time to transmit; often those requests are unintentionally large.

By setting Max records and/or Max file size, you can control such incidences.

Note that the Client has settings that can override these settings.

Setting up the server:


To test abcDB™ Wireless, you can run the Application Server on the same computer
that is connected to your device.

You must make sure of the following:


Your server computer must have TCP/IP installed.

234
I T ’ S A S E A S Y A S A - B - C !

Your server computer must be running the abcDB™-dbBridge server application,


and should be connected to from the Internet (unless you are of course using
abcDB™ 'locally' via intranet.)

A. Set up User database

Locate the folder holding the demo databases. For example:

C:\Program files\Dalco\dbBridge abcDB\Databases

There should be a users.mdb file located here.


Please ensure that there is a valid record in the USERS table contained in this
database. For example, try adding a record that contains a value of 'GUEST' for both
the UserName and UserPassword fields.

Open the ODBC Data Source Administrator - Start > Settings > Control Panel > ODBC
Data sources

Click [Add], then double-click Microsoft Access Driver (*.mdb).

Add a Data Source Name: abcDBUsers for example.

Use [Select] to locate and select the database users.mdb.

Click [OK] and [OK] to close the ODBC Data Source Administrator.

235
I T ’ S A S E A S Y A S A - B - C !

B. Create an ODBC connection to your database

Ensure Steps 1 and 2 of A. Set up User database have been done.

Open the ODBC Data Source Administrator - Start > Settings > Control Panel > ODBC
Data sources

Click [Add], then double-click Microsoft Access Driver (*.mdb).

Add a Data Source Name:abcTEST for example.

Use [Select] to locate and select the database abcTEST.mdb in the following folder:
x:\program files\abcDB™\samples\remote

Click [OK] and [OK] to close the ODBC Data Source Administrator.

C. Run the server

Locate and launch the server executable - Start > Programs > dbBridge for PocketPC >
dbBridge ADOServer for abcDB™.

When the Designate listening Port dialog displays, enter 9005 or some similar
number and click [OK].

(Note that if you have any type of server application running that uses this Port

236
I T ’ S A S E A S Y A S A - B - C !

number, you will not be able to open the dbBridge/abcDB™ ADO Demo Server. You
will have to retry using a different number.)

When the Source of connection dialog displays, select the Use Connection String
option and click [Build].

Set the Provider as Microsoft OLE DB Provider for ODBC Drivers and click [Next].

237
I T ’ S A S E A S Y A S A - B - C !

For the connection, select the User data source name option, click the dropdown and
select abcTEST from the list, then click [OK] to finish the process.

238
I T ’ S A S E A S Y A S A - B - C !

Click [OK] to close the Source of connection dialog.

When the Server Login dialog displays, click [OK]. There is no user name or password
required.

You now need to repeat Steps 3 to 6, except select abcDBUsers as the data source
name.

When the Database Login displays for the UserValidationDatabase, click [OK]. There is
no user name or password set for the database. Click [OK].

The dbBridge application server should now display. Check the [Settings] tab. The
best settings when starting out are:

Server settings Client settings

239
I T ’ S A S E A S Y A S A - B - C !

Display ON Allow Null ON

Intercept OFF Blobs As Params OFF

Remove IS NULL ON Quote Date Fields OFF

Limit Select * (1) ON Need exec prepared ON

Enable GetNext Packet ON Log date format NUMBER

Quote char (double


Strip table owner prepend ON "
quote)

Use Threads OFF DBMS Name DBBRIDGE

Max pooled threads -


5 Max records per packet 0
should be at least

ValidUserIDs only OFF Max file size 0

Max Records count (keep


the number of records in
Always approve ON 100
the total response low
when testing)

Allow COUNT ON

Allow UPPER ON

Allow Guest as valid user ON

240
I T ’ S A S E A S Y A S A - B - C !

H
Appendix

Appendix H – Importing Data from


Other ODBC Data Sources
Although ActiveSync is primarily used to import from Microsoft Access, you can also import
data from a variety of other data sources. For example, you can import data from ORACLE,
SQL Server, xBase, etc… While synchronization can be a challenge when using ODBC,
the fact that you can at least import data can be a tremendous benefit.
The following tutorial will demonstrate how to import data from a Microsoft Foxpro *.DBF
table. The procedure will basically be identical for other ODBC data sources.
The first step in importing data from an ODBC
data source other than MS Access is to create a
new data source by means of the ODBC Data
Source Administrator. In Windows 95/98 It can
be found by clicking
START/SETTINGS/CONTROL PANEL
Note: In Windows XP you can find it in START/ADMINISTRATIVE
TOOLS/DATA SOURCES (ODBC)

In Windows 2000, look in START/SETTINGS/CONTROL


PANEL/ADMINISTRATIVE TOOLS/DATA SOURCES(ODBC)

Notice that there are several tabs on this screen.


In this case, we want to create a connection that
will be visible to all users of this computer, so
we’ll move to the SYSTEM DSN tab.

Now click the ADD button and proceed to the


next step …

241
I T ’ S A S E A S Y A S A - B - C !

Now we need to choose the ‘driver’ that will be


used to connect to our datasource. In this case,
since we’re attempting to connect to a Foxpro
table, we’ve selected the Microsoft dBase VFP
Driver.

Click FINISH and proceed to the next step…

Here we’ve entered the name for our Data


Source Name (DSN). We’ve named it
‘ActiveSync_ODBC_TEST’

We’ve also indicated that the database type is a


‘Free Table Directory’, and that our data table(s)
are located in the ‘C:\SBT\KB’ folder.

We’ll now Click OK to save our new DSN.

We’re now taken back to our initial screen, and


we can see that our new DSN is located in the
list of ‘System Data Sources’

Let’s click OK at the bottom of the screen, and


we’ll now try to ‘import’ a Foxpro table into our
PocketPC so that abcDB can access the data.

242
I T ’ S A S E A S Y A S A - B - C !

Ok, here we are in ActiveSync again.

Of course, we need to make sure our device is


cradled and ActiveSync is connected.

Now we’ll select the TOOLS/IMPORT menu


option, and move to the next step …

We now need to change the default file type


from Microsoft Access to ODBC DATABASE.

As soon as we do, you’ll be taken to the screen


as shown in our next step …

Now we’re given the chance to choose which


data source we want to ‘import’ from.

Notice that there are two main tabs on this


screen, ‘File Data Source’ and ‘Machine Data
Source’.

Choose MACHINE DATA SOURCE tab, and you


can see that our newly created
‘ActiveSync_ODBC_TEST’ DSN is in the list.

Let’s choose it and click OK…

243
I T ’ S A S E A S Y A S A - B - C !

We now need to confirm the configuration for


this connection.

For now we’ll just click OK to continue …

We’re now presented with a list of ALL the tables


contained in our DSN.

For the purpose of this demonstration, I’m only


going to import the ARMAST01 table which
includes my Accounts Receivable data.

Once I import this to my PocketPC, I’ll be able to


use abcDB to review how much my various
customers owe, invoice numbers, etc…

Let’s click OK …

ActiveSync is now busy ‘importing’ my


ARMAST01 table. When it’s complete, let’s start
abcDB and make sure it worked …

244
I T ’ S A S E A S Y A S A - B - C !

Sure enough! We were able to open our


‘ActiveSync_ODBC_TEST’ database, and here’s
the contents:

Let’s open the table just to make sure we got all


the records …

COOL! There it is!

And that’s all there is to importing data from a


Microsoft Foxpro database table.

As mentioned earlier, the same basic procedure


applies to the other data types such as SQL
Server, Oracle, etc…

245
I T ’ S A S E A S Y A S A - B - C !

I
Appendix

Appendix I – Frequently Asked


Questions
Question Answer

Can I import forms, Unfortunately due to inherent weaknesses in the underlying database
queries, macros, or engine supplied by Microsoft, it is simply not possible to import
modules from my MS forms/queries/macros/modules onto your PocketPC. This is less than
Access database? ideal I agree. We're currently working on ways of getting around
this. In the meantime, any queries or forms will need to be created
in abcDB.

It would also be good to note that even if you could import your
forms, most would not work due to the fact that the SQL Language
for the PocketPC is VERY limited as compared to the SQL we're
accustomed to using on our desktop computers. Here is a link to
Microsoft's website that details what is possible on the PocketPC:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/adoce31/html/ado30ref_83.asp

Will abcDB run on HPC No. Although we hope to offer an HPC version in the future, at
devices such as the this time abcDB will only run on PocketPC’s.
Jornada 720?

Can I import data from Yes. When you click the TOOLS/IMPORT menu in ActiveSync,
any other database other you can change the default file type from MS Access to ODBC
than MS Access? Database. Then you can select any database for which there is
an ODBC DSN created.

Is there any limitation to The Microsoft PocketPC Database Engine has a maximum of
the number of fields or approx. 65000 records per table, and 255 fields per table.
records that a table can
have?

246
I T ’ S A S E A S Y A S A - B - C !

Can I create tables in You can create tables in abcDB.


abcDB? Or MUST I
import them from an
existing desktop database?

Can I distribute the forms All the form/query definitions are stored in system tables that
and queries I’ve abcDB creates in your database.
developed to other
PocketPC’s running Here is how to ‘distribute’ your abcDB application to other
abcDB? PocketPC’s:

1. Import your database to your PocketPC


2. Create your forms/queries/tables/etc...
3. COPY the *.CDB database file from your PocketPC Back to your
desktop.
4. If you have MS Access, open your original desktop database and
IMPORT all the tables from your PocketPC copy (step 3) that start
with the letters xSysAbc*.
5. Once the xSysAbc* tables are in your original database, you can
then import it back to your PPC and/or any other PocketPC running
abcDB.

If you make ANY changes to a form and/or query, you'll need to repeat
steps 3-5.

Can I use barcode Yes. We have successfully used Socket Communications


scanners with abcDB? scanners.

247
I T ’ S A S E A S Y A S A - B - C !

J
Appendix

Appendix J – Supported Printers


(abcDB Print enabled versions
only)
Printers Supported

- HP - most DeskJet** & LaserJet printers - all PCL3 compatible,


including HP 450cbi & 350cbi
- Canon compatible printers (including BJC-50/55 and BJC-80/85)
- Epson Stylus, ESC/P2, and 24-pin LQ compatible printers
- Pentax PocketJet 200 and PocketJet II
- Brother m-PRINT MW-100
- Citizen PD-22 & PD-04
- Seiko DPU-3445
- Extech
- Zebra QL320 + Cameo & Encore (CPL-compatible Zebra printers)
- O'Neil MicroFlash
- More...

Selected Printers

HP LaserJets
HP 450cbi
and 350CBi HP DeskJets

248
I T ’ S A S E A S Y A S A - B - C !

Brother m-PRINT MW-100


Pentax PocketJet 200 Citizen PD-22 & PD-04

Canon BJC-80/85 & SiPix A6


Seiko DPU-3445
BJC-50 + most Canon BubbleJet printers ***See note below

Extech Thermal Printers O'Neil MicroFlash

Zebra QL, Cameo & Encore

249
I T ’ S A S E A S Y A S A - B - C !

**HP PhotoSmart 1000 & 1100 series printers use a non-standard Infrared
port which has been reported to not work with our printing products.
The PhotoSmart 12xx and later series of printers work great.
***SiPix A6 printers are supported, but some HP Jornada devices are unable to successfully establish an
Infrared link with SiPix.

250
I T ’ S A S E A S Y A S A - B - C !

K
Appendix

Appendix K – Using abcDB with


GPS Receivers

W
ith the release of abcDB v5.0, it was possible to retrieve data from connected GPS
(Global Positioning System) receivers.

What does this mean to you as a developer? Simple. POWER!

Consider the possibilities. Perhaps you need to develop an asset tracking application. Now
you can EASILY capture GPS coordinates for each asset.

Perhaps you’re a fisherman and want to be able to find the ‘sweet spot’ again next year?
Simple! Just take your PocketPC along with you, and when you catch the ‘big one’, just
capture the precise location and save it to your abcDB database.

There are endless possible uses for GPS applications. It’s completely up to your imagination.

COMPATIBLE DEVICES
We cannot guarantee compatibility with all GPS devices. We do however have some basic
guidelines that will hopefully help determine if your GPS will work with abcDB or not.

First of all, your device MUST meet the NMEA (National Marine Electronics Association)
standard. Your device must also work on your PocketPC’s serial port (Ports 1 – 4)

abcDB is designed to specifically look for data in two NMEA sentences:

GPRMC (Recommended minimum specific GNSS data)


- Example
$GPRMC,235947.000,A,4250.5589,S,14718.5084,E,0.00,89.68,211200,,*25

GPGGA (Global Positioning System Fixed Data)


- Example
$GPGGA,092204.999,4250.5589,S,14718.5084,E,1,04,24.4,19.7,M,,,,0000*1F

You will want to refer to your device’s documentation and ensure that you use GPSINIT to
send any initialization strings that might be required to enable the output of these two

251
I T ’ S A S E A S Y A S A - B - C !

sentence types. If your GPS does not send these two sentences, abcDB will not be able to
return any valid data.

The important fact is that abcDB now makes it EASY to capture your GPS data, and in a
moment we’ll demonstrate how easy it really is.

First of all, you need to be aware of the basic GPS specific statements and functions that are
now included in abcDB. They are:

GPSOPEN – This statement very simply OPENS the port to your GPS device. Please note that
abcDB currently supports GPS’s that are compliant with the NMEA standard (National Marine
Electronics Association).
GPSINIT – This statement sends optional ‘initialization’ strings to your GPS.
GPSCLOSE – Closes the port to your GPS device.
GPSLAT – Returns the Latitude of your current location.
GPSLONG – Returns the Longitude of your current location.
GPSALT – Returns the your current Altitude.
GPSALTUNIT – Returns the units that your altitude is recorded in (ie. Meters)
GPSTIME – Returns the current GPS time.
GPSSPEED – Returns your current ground speed (in knots)
GPSMAXSPEED – Returns the maximum speed you’ve traveled at since your last GPSINIT.
GPSMAXALT – Returns the maximum altitude you’ve reached since your last GPSINIT
GPSOK – Returns TRUE if there is sufficient satellite data. Otherwise returns FALSE NOTE:
GPS devices take some time to acquire all the necessary satellites. As a result, GPSOK may
not register TRUE for several minutes depending on the type of device you have.
GPSDATE – Returns the current GPS date.

So let’s create a quick little application that will demonstrate how to put these features to use:

First of all, let’s add textboxes, labels, and buttons


to our new form so that is looks similar to this.

Give your textboxes TAG values of:

Latitude
longitude
altitude
Time
Speed
MaxSpeed
MaxAlt
GPSOK
AltUnits

Once you’re done, move to the next step.

252
I T ’ S A S E A S Y A S A - B - C !

Now, in the GPS OPEN button’s ONCLICK event,


enter the following code:

GPSOPEN(“4”//”4800,N,8,1”)

Note: The “4800,N,8,1” is a fairly standard setting


for many NMEA GPS units. The first parameter
tells abcDB what serial port your GPS is
configured to use. In my case the device uses
communications Port #4.

Then, in the GPS INIT button’s ONCLICK event,


enter the following single line of code:

gpsinit("$PRWIILOG,RMC,A,T,2,0"//"$PRWIILOG,
GGA,A,T,2,0"//"$PRWIILOG,ZCH,V,,,")

In my case, the first two parameters tell the GPS


device to automatically output data every two
seconds. The 3rd parameter turns off certain data
that is unnecessary.

Note: We could just as easily have added this


GPSINIT statement to our GPS OPEN button.
There is no real need to have two separate
buttons. We are just trying to demonstrate the
individual steps that occur.

Then, in your GET VALUES button, enter the


following ONCLICK event code:

SETVALUE(~Latitude~//GPSLAT())
SETVALUE(~Longitude~//GPSLong())
SETVALUE(~Altitude~//GPSalt())
SETVALUE(~Time~//GPStime())
SETVALUE(~Speed~//GPSspeed())
SETVALUE(~MaxSpeed~//GPSmaxspeed())
SETVALUE(~MaxAlt~//GPSmaxalt())
SETVALUE(~GPSOK~//GPSok())
SETVALUE(~AltUnits~//GPSaltunit())

FINALLY, enter the following line of code in your


GPS CLOSE button’s ONCLICK event:

GPSCLOSE()

Now SAVE your form and then run it.

253
I T ’ S A S E A S Y A S A - B - C !

Assuming that your GPS is compatible and


you’ve used the correct settings in your
GPSOPEN and GPSINIT commands, you can
now test everything out.

First, tap the GPS OPEN button to execute the


GPSOPEN statement and open a connection to
your GPS device.

Secondly, tap the GPS INIT button to send the


optional initialization strings to your device.

Then, if everything is working properly, you


should be able to tap the GET VALUES button,
and you’ll hopefully see something similar to this
screen.

(NOTE: Some GPS devices take several minutes


to initialize.)

Of course, this simple application doesn’t do


anything other than ‘display’ the GPS data. We
could just as easily have created a table, and
saved this data for future reference. We’ll leave
that up to you!

254
I T ’ S A S E A S Y A S A - B - C !

L
Appendix

Appendix L – Outlook fields


CONTACTS COLLECTION

Valid fields contained in the “Contacts” Collection are:


"ANNIVERSARY"
"ASSISTANTNAME"
"ASSISTANTTELEPHONENUMBER"
"BIRTHDAY"
"BODY"
"BUSINESS2TELEPHONENUMBER"
"BUSINESSADDRESSCITY"
"BUSINESSADDRESSCOUNTRY"
"BUSINESSADDRESSPOSTALCODE"
"BUSINESSADDRESSSTATE"
"BUSINESSADDRESSSTREET"
"BUSINESSFAXNUMBER"
"BUSINESSTELEPHONENUMBER"
"CARTELEPHONENUMBER"
"CATEGORIES"
"CHILDREN"
"COMPANYNAME"
"DEPARTMENT"
"EMAIL1ADDRESS"
"EMAIL2ADDRESS"
"EMAIL3ADDRESS"
"FILEAS"
"FIRSTNAME"
"HOME2TELEPHONENUMBER"
"HOMEADDRESSCITY"
"HOMEADDRESSCOUNTRY"
"HOMEADDRESSPOSTALCODE"
"HOMEADDRESSSTATE"
"HOMEADDRESSSTREET"
"HOMEFAXNUMBER"
"HOMETELEPHONENUMBER"
"JOBTITLE"
"LASTNAME"
"MIDDLENAME"
"MOBILETELEPHONENUMBER"
"OFFICELOCATION"
"OTHERADDRESSCITY"
"OTHERADDRESSCOUNTRY"
"OTHERADDRESSPOSTALCODE"
"OTHERADDRESSSTATE"
"OTHERADDRESSSTREET"
"PAGERNUMBER"
"RADIOTELEPHONENUMBER"
"SPOUSE"
"SUFFIX"

255
I T ’ S A S E A S Y A S A - B - C !

"TITLE"
"WEBPAGE"
"YOMICOMPANYNAME"
"YOMIFIRSTNAME"
"YOMILASTNAME"

TASKS COLLECTION

Valid fields contained in the “TASKS” Collection are:


"BODY"
"COMPLETE"
"DATECOMPLETED"
"DUEDATE"
"IMPORTANCE"
"ISRECURRING"
"RECURRENCEPATTERN"
"REMINDEROPTIONS"
"REMINDERSET"
"REMINDERSOUNDFILE"
"REMINDERTIME"
"SENSITIVITY"
"STARTDATE"
"SUBJECT"
"TEAMTASK"

CALENDAR COLLECTION

Valid fields contained in the “CALENDAR” Collection are:


"ALLDAYEVENT"
"BODY"
"BUSYSTATUS"
"CATEGORIES"
"DURATION"
"END"
"ISRECURRING"
"LOCATION"
"MEETINGSTATUS"
"RECIPIENTS"
"RECURRENCEPATTERN"
"REMINDERMINUTESBEFORESTART"
"REMINDEROPTIONS"
"REMINDERSET"
"REMINDERSOUNDFILE"
"SENSITIVITY"
"START"
"SUBJECT"

256
I T ’ S A S E A S Y A S A - B - C !

M
Appendix

Appendix M – Implementing
Webservices

S
ince the release of abcDB v6.15, it has been possible to retrieve data from remote
webservers using 'web services'

Doing so is not difficult at all, as long as you have the ability to add special methods to
your webserver. Below is a sample listing of code (using Visual Basic .Net) that illustrates a
bare framework of methods/functions necessary for abcDB to be able to use.

Notice that you are currently permitted 13 different functions. All 13 functions MUST be
named Function1, function2, function3 … Function13. In addition to this, these functions
must all accept 5 arguments of type 'String', and each function must return a string value.

Once your webservices have been implemented, calling them is as easy as this:

SETMEM(CustBalance//WEBSERVICE(1,"www.YourServer.com/service1.smpx","CUST22","","","",""))

The above abcDB code sample would query the FUNCTION1 method on your server for the
current account balance of the customer whose customer ID is "CUST22". Assuming you've
implemented the necessary code/logic in FUNCTION1, abcDB should receive the balance
back in the form of a string value (ie. "$945.22")

Webservices open up a whole new world of possibilities with abcDB. Let your imagination
be your guide!

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.IO
Imports System.Collections
Imports System.Drawing
Imports System.Drawing.Imaging

<System.Web.Services.WebService(Namespace:="abcDBWebService")> _
Public Class Service1
Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

257
I T ’ S A S E A S Y A S A - B - C !

Public Sub New()


MyBase.New()

'This call is required by the Web Services Designer.


InitializeComponent()

'Add your own initialization code after the InitializeComponent()


call

End Sub

'Required by the Web Services Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer


'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container
End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)


'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

#End Region

<WebMethod()> _
Public Function Function1(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function1"
End Function

<WebMethod()> _
Public Function Function2(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function2"
End Function

<WebMethod()> _
Public Function Function3(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function3"
End Function

<WebMethod()> _
Public Function Function4(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String

258
I T ’ S A S E A S Y A S A - B - C !

Return "Function4"
End Function

<WebMethod()> _
Public Function Function5(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function5"
End Function

<WebMethod()> _
Public Function Function6(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function6"
End Function

<WebMethod()> _
Public Function Function7(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function7"
End Function

<WebMethod()> _
Public Function Function8(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function8"
End Function

<WebMethod()> _
Public Function Function9(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function9"
End Function

<WebMethod()> _
Public Function Function10(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function10"
End Function

<WebMethod()> _
Public Function Function11(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function11"
End Function

<WebMethod()> _
Public Function Function12(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function12"
End Function
<WebMethod()> _
Public Function Function13(ByVal arg1 As String, ByVal arg2 As String,
ByVal arg3 As String, ByVal arg4 As String, ByVal arg5 As String) As String
Return "Function13"

259
I T ’ S A S E A S Y A S A - B - C !

End Function

End Class

260
I T ’ S A S E A S Y A S A - B - C !

Index
A
ABS ................................................................................................................................................................... 185
Appendix ........................................................................................................................................................... 248
ASC................................................................................................................................................................... 185
AUTOFORM ....................................................................................................................................................... 39
AUTOID............................................................................................................................................................ 185
AutoNumber ...................................................................................................................................................... 210
B
barcode .............................................................................................................................................................. 122
C
CALCULATOR’ Application............................................................................................................................... 90
CAPTION.................................................................................................................... 140, 141, 142, 143, 157, 166
CHECKBOXES ................................................................................................................................................... 62
CHR .................................................................................................................................................................. 186
Close Button ........................................................................................................................................................ 81
COLOR ............................................................................................................................................................. 141
COMMAND ........................................................................................................................................................ 62
COMMANDS
CAPTION................................................................................................................................................... 81, 83
EVAL ............................................................................................................................................................... 92
FORMOPEN..................................................................................................................................................... 85
GRIDREFRESH ............................................................................................................................................... 78
IMAGE............................................................................................................................................................. 83
MESSAGE........................................................................................................................................................ 73
POWERPICK ................................................................................................................................................... 87
SCRIBCLEAR.................................................................................................................................................. 83
SCRIBSAVE .................................................................................................................................................... 83
SETMEM ........................................................................................................................................................See
TEST ................................................................................................................................................................ 83
VISIBLE..................................................................................................................................................... 81, 83
copy..................................................................................................................................................................... 11
CURRENTTAB ................................................................................................................................................. 187
D
DADD ............................................................................................................................................................... 187
Databases
What are they? .................................................................................................................................................. 10
DATE ................................................................................................................................................................ 187
DATEPICKER..................................................................................................................................................... 62
DATETIME....................................................................................................................................................... 188
DAY .................................................................................................................................................................. 188
DDIFF ............................................................................................................................................................... 188
DETAIL..............................................................................................................................................................See
dropdown ............................................................................................................................................................See
DROPDOWN ...................................................................................................................................................... 62
DROPREFRESH................................................................................................................................................ 144

261
I T ’ S A S E A S Y A S A - B - C !

DSN................................................................................................................................................................... 241
E
ENABLE ........................................................................................................................................................... 144
ENCRYPTION .................................................................................................................................................. 227
ENDWHILE ...................................................................................................................................................... 167
eval ................................................................................................................................................................... 92
EVAL ................................................................................................................................................................ 189
Events
On Add ........................................................................................................................................................... 171
On Delete........................................................................................................................................................ 171
On Open ......................................................................................................................................................... 171
Timer Event .................................................................................................................................................... 171
EVENTS
On Current ...................................................................................................................................................... 171
EXECUTE ......................................................................................................................................................... 145
EXIT.................................................................................................................................................................. 145
EXITAPP .................................................................................................................................................... 89, 146
EXP ................................................................................................................................................................... 189
EXPORT.....................................................................................................................................................146, 150
F
FIELD PICKER ................................................................................................................................................... 40
Field Types ........................................................................................................................................................ 130
Boolean........................................................................................................................................................... 130
Date/Time ....................................................................................................................................................... 130
Double ............................................................................................................................................................ 130
ID GUID......................................................................................................................................................... 130
ID Increment ................................................................................................................................................... 130
ID Random ..................................................................................................................................................... 130
Integer............................................................................................................................................................. 130
Memo ............................................................................................................................................................. 130
Ole.................................................................................................................................................................. 131
SmallInt .......................................................................................................................................................... 131
Text ................................................................................................................................................................ 130
VarBinary ....................................................................................................................................................... 131
FIELDS
Referencing....................................................................................................................................................... 64
FILEPICK.......................................................................................................................................................... 189
Filter
By Selection...................................................................................................................................................... 15
Excluding Selection........................................................................................................................................... 15
For... ................................................................................................................................................................. 15
Filters................................................................................................................................................................... 25
FIREWALL ....................................................................................................................................................... 227
FONT ................................................................................................................................................................ 146
FORMAT .......................................................................................................................................................... 190
FORMOPEN .............................................................................................................................................. 85, 147
FORMREQUERY ........................................................................................................................................... 96, 148
Forms
Creating/Editing................................................................................................................................................ 38
Delete ............................................................................................................................................................... 13
Edit ................................................................................................................................................................... 13
New .................................................................................................................................................................. 13
Open ................................................................................................................................................................. 13
UsingForms........................................................................................................................................................... 36

262
I T ’ S A S E A S Y A S A - B - C !

What are they? .................................................................................................................................................. 11


Foxpro.................................................................................................................................................................. 241
Frequently Asked Questions ............................................................................................................................... 246
G
GOTO................................................................................................................................................................ 148
GPS COMPATIBLE DEVICES ........................................................................................................................ 250
GPS Receivers ............................................................................................................................................250, 254
GPSALT ............................................................................................................................................................ 191
GPSALTUNIT ................................................................................................................................................... 191
GPSCLOSE ....................................................................................................................................................... 149
GPSDATE ......................................................................................................................................................... 191
GPSINIT............................................................................................................................................................ 149
GPSLAT .....................................................................................................................................................192, 193
GPSLONG......................................................................................................................................................... 192
GPSMAXALT ................................................................................................................................................... 192
GPSMAXSPEED............................................................................................................................................... 193
GPSOK.............................................................................................................................................................. 193
GPSOPEN ......................................................................................................................................................... 149
GPSSPEED........................................................................................................................................................ 194
GPSTIME .......................................................................................................................................................... 194
GRID ................................................................................................................................................................... 63
GRIDCOL ......................................................................................................................................................... 194
GRIDREFRESH ................................................................................................................................................ 149
GUID........................................................................................................................................................... 30, 221
H
Hardware
Requirements .................................................................................................................................................... 17
Hardware requirements......................................................................................................................................... 17
Hello-World Sample............................................................................................................................................. 67
HOUR................................................................................................................................................................ 195
I
IMAGE...................................................................................................................................................63, 83, 150
Importing data...................................................................................................................................................... 20
INPUT ............................................................................................................................................................... 195
Installing.............................................................................................................................................................. 17
Installing abcDB................................................................................................................................................... 17
INSTR ............................................................................................................................................................... 195
L
LABELS .............................................................................................................................................................. 63
LEFT ................................................................................................................................................................. 196
LEN................................................................................................................................................................... 196
LINK FIELD (CHILD)......................................................................................................................................... 95
LINK FIELD (Master).......................................................................................................................................... 95
LISTVIEW ........................................................................................................................................................ 151
LOOKUP ........................................................................................................................................................... 197
M
Menu
Delete Record.................................................................................................................................................... 16
Move to first ..................................................................................................................................................... 16
Move to Last ..................................................................................................................................................... 16
Move to Next .................................................................................................................................................... 16

263
I T ’ S A S E A S Y A S A - B - C !

Move to Previous .............................................................................................................................................. 16


New Record ...................................................................................................................................................... 16
MESSAGEBOX................................................................................................................................................. 197
MID................................................................................................................................................................... 198
MINUTE............................................................................................................................................................ 199
Module1............................................................................................................................................................. 170
Module2............................................................................................................................................................. 170
Module3............................................................................................................................................................. 170
Module4............................................................................................................................................................. 171
Module5............................................................................................................................................................. 171
MODULES
All about ........................................................................................................................................................... 65
MONTH ............................................................................................................................................................ 199
MONTHNAME ................................................................................................................................................. 199
MOVE ............................................................................................................................................................... 153
MOVEFIRST..................................................................................................................................................... 153
MOVELAST...................................................................................................................................................... 153
MOVENEXT ..................................................................................................................................................... 154
MOVEPREV ..................................................................................................................................................... 154
MOVETO ............................................................................................................................154, 155, 156, 200, 201
N
NAVIGATION MENU .................................................................................................................................. 16, 80
NAVIGATION MENU....................................................................................................................................... 14
NEXTID ............................................................................................................................................................ 199
O
ODBC........................................................................................................................................... 21, 225, 226, 241
ODBC Data Source Administrator ...................................................................................................................... 241
OLE Fields........................................................................................................................................................... 22
OLEDB ......................................................................................................................................................225, 226
P
parameter queries ................................................................................................................................................. 32
Password............................................................................................................................................................ 170
paste .................................................................................................................................................................... 11
PLAYSOUND............................................................................................................................................. 91, 156
POWERPICK ............................................................................................................................................. 87, 156
PRIMARY KEY ................................................................................................................................................ 210
PRINT ............................................................................................................................................................... 157
Printers
Supported........................................................................................................................................................ 248
printing .............................................................................................................................................................. 122
Printing .............................................................................................................................................................. 118
Properties
Checkbox Control ........................................................................................................................................... 177
Command Control ........................................................................................................................................... 176
Date Picker...................................................................................................................................................... 180
Dropdown Control........................................................................................................................................... 173
Grid Control.................................................................................................................................................... 178
Image Control ................................................................................................................................................. 182
Label Control .................................................................................................................................................. 175
Scribble Control .............................................................................................................................................. 181
TAG ................................................................................................................................................................. 64
Textbox........................................................................................................................................................... 171
PROPERTIES

264
I T ’ S A S E A S Y A S A - B - C !

FORM............................................................................................................................................................. 169
PROPERTIES window......................................................................................................................................... 64
Q
Queries
Creating ............................................................................................................................................................ 30
Editing .............................................................................................................................................................. 34
Open ................................................................................................................................................................. 12
Parameter.......................................................................................................................................................... 32
What are they? .................................................................................................................................................. 11
Query-Builder ...................................................................................................................................................... 31
QUIT ................................................................................................................................................................. 158
R
RANDOM ......................................................................................................................................................... 201
REALTOR Application ........................................................................................................................................ 73
RECCOUNT ...................................................................................................................................................... 202
RECNO ............................................................................................................................................................. 202
RECORDDELETE............................................................................................................................................. 158
RECORDNEW .................................................................................................................................................. 158
RECORDS
Adding.............................................................................................................................................................. 16
RECORDSAVE ................................................................................................................................................. 159
relational ....................................................................................................................................................... 38, See
REPLACE ......................................................................................................................................................... 202
Results
Detail ...............................................................................................................................................................See
RESULTS............................................................................................................................................................ 13
RETURN ........................................................................................................................................................... 159
RIGHT............................................................................................................................................................... 203
RNDID .............................................................................................................................................................. 203
ROUND............................................................................................................................................................. 203
RUNAPP ........................................................................................................................................................... 160
RUNSQL ........................................................................................................................................................... 160
RUNSUB........................................................................................................................................................... 160
RUNUPDATE ................................................................................................................................................... 161
S
SCRIBBLE .......................................................................................................................................................... 63
SCRIBCLEAR.............................................................................................................................................. 83, 161
SCRIBFSAVE ............................................................................................................................................161, 162
SCRIBSAVE........................................................................................................................................................ 83
Script Builder....................................................................................................................................................... 70
Scrollbar(Horiz) ................................................................................................................................................... 81
Scrollbar(Vert) ..................................................................................................................................................... 81
SECOND ........................................................................................................................................................... 204
SETFIELD......................................................................................................................................................... 162
SETFOCUS ....................................................................................................................................................... 163
SETMEM .......................................................................................................................................................... 163
SETTAB............................................................................................................................................................ 163
SETVALUE....................................................................................................................................................... 164
SIN .................................................................................................................................................................... 204
SIP..................................................................................................................................................................... 164
Sort
Ascending ......................................................................................................................................................... 15
Descending ....................................................................................................................................................... 15

265
I T ’ S A S E A S Y A S A - B - C !

SQL
SELECT – Join ............................................................................................................................................... 132
SQR................................................................................................................................................................... 204
Starting abcDB..................................................................................................................................................... 19
Subform1 ........................................................................................................................................................... 170
Subform2 ........................................................................................................................................................... 170
Subform3 ........................................................................................................................................................... 170
Subform4 ........................................................................................................................................................... 170
Subform5 ........................................................................................................................................................... 170
SUBFORMREFRESH........................................................................................................................................ 164
SUBFORMS
All about ........................................................................................................................................................... 98
Synchronize ....................................................................................................................................................... 210
SYSTEM DSN................................................................................................................................................... 241
T
TAB
Adding a tab to your form.................................................................................................................................. 48
TAB control....................................................................................................................................................... 183
TAB control Properties....................................................................................................................................... 183
Tables .................................................................................................................................................................. 12
Creating ............................................................................................................................................................ 23
Delete ............................................................................................................................................................... 12
Edit ................................................................................................................................................................... 12
Editing ........................................................................................................................................................ 25, 29
New .................................................................................................................................................................. 12
Using Tables and Filters .................................................................................................................................... 25
What are they? .................................................................................................................................................. 11
TAG .................................................................................................................................................................... 64
TAGS
All about ........................................................................................................................................................... 64
TAN .................................................................................................................................................................. 204
TAVG................................................................................................................................................................ 205
TCOUNT ........................................................................................................................................................... 205
TCP/IP.............................................................................................................................................................. 235
TEST ................................................................................................................................................................. 165
TEXTBOX........................................................................................................................................................... 62
TID.................................................................................................................................................................... 205
TIME ................................................................................................................................................................. 206
TIMER .............................................................................................................................................................. 165
TMAX ............................................................................................................................................................... 206
TMIN................................................................................................................................................................. 206
TSUM................................................................................................................................................................ 207
U
User database ................................................................................................................................................... 235
V
VARIABLES
All about ........................................................................................................................................................... 65
VISIBLE............................................................................................................................................................ 166
W
WEEKDAY ....................................................................................................................................................... 207
WEEKDAYNAME ............................................................................................................................................ 208
WHILE .............................................................................................................................................................. 167

266
I T ’ S A S E A S Y A S A - B - C !

WINDOWPOS................................................................................................................................................... 167
Wireless’............................................................................................................................................................ 225
Y
YEAR................................................................................................................................................................ 208
Z
ZOOM ......................................................................................................................................................... 13, 168
ZORDER ........................................................................................................................................................... 168

267

Das könnte Ihnen auch gefallen