Beruflich Dokumente
Kultur Dokumente
Volume
POCKETSOFT.CA
abcDB™ v6.15 ‘Database’ Manual
‘abcDB’ Database
v6.15
WWW.POCKETSOFT. CA
2001-2004 by PocketSOFT.ca
Email: support@PocketSOFT.ca
Website: http://www.PocketSOFT.ca
Table of Contents
WHAT’S NEW? 8
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
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
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
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
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.
• 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
• Treeview control
• Listbox control
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
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.
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.
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.
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:
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.
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:
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.
13
I T ’ S A S E A S Y A S A - B - C !
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.
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 !
Filter
Description
Type
Filter
Filters the table excluding the contents of the
excluding
currently selected field.
selection
Field
Will allow you to do a ‘wildcard’ search.
Contains …
15
I T ’ S A S E A S Y A S A - B - C !
16
I T ’ S A S E A S Y A S A - B - C !
2
Chapter
A
bcDB Database will run on any PocketPC running either the Microsoft PocketPC 2000,
PocketPC 2002 OR the newest PocketPC 2003 Operating System.
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.
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:
18
I T ’ S A S E A S Y A S A - B - C !
3
Chapter
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.
19
I T ’ S A S E A S Y A S A - B - C !
20
I T ’ S A S E A S Y A S A - B - C !
21
I T ’ S A S E A S Y A S A - B - C !
22
I T ’ S A S E A S Y A S A - B - C !
23
I T ’ S A S E A S Y A S A - B - C !
FieldName: Lastname
FieldType: TEXT
Size: 50
FieldName: Address
FieldType: TEXT
Size: 50
FieldName: City
FieldType: TEXT
Size: 50
24
I T ’ S A S E A S Y A S A - B - C !
25
I T ’ S A S E A S Y A S A - B - C !
26
I T ’ S A S E A S Y A S A - B - C !
27
I T ’ S A S E A S Y A S A - B - C !
28
I T ’ S A S E A S Y A S A - B - C !
29
I T ’ S A S E A S Y A S A - B - C !
30
I T ’ S A S E A S Y A S A - B - C !
= True
!
If we tap the run button ( ), we’ll see the results.
31
I T ’ S A S E A S Y A S A - B - C !
= ‘Tery’
= ‘<<Name>>’
32
I T ’ S A S E A S Y A S A - B - C !
1. Select MyPatients
2. Tap OPEN
33
I T ’ S A S E A S Y A S A - B - C !
34
I T ’ S A S E A S Y A S A - B - C !
Tap EDIT.
35
I T ’ S A S E A S Y A S A - B - C !
4
Chapter
Chapter 4 – FORMS
36
I T ’ S A S E A S Y A S A - B - C !
We can also view all the counties for the chosen state.
Let’s tap COUNTIES and see what happens.
37
I T ’ S A S E A S Y A S A - B - C !
But for now, let’s move on to the next section and we’ll
see how to create your own forms.
38
I T ’ S A S E A S Y A S A - B - C !
39
I T ’ S A S E A S Y A S A - B - C !
40
I T ’ S A S E A S Y A S A - B - C !
Click YES.
41
I T ’ S A S E A S Y A S A - B - C !
42
I T ’ S A S E A S Y A S A - B - C !
43
I T ’ S A S E A S Y A S A - B - C !
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.
44
I T ’ S A S E A S Y A S A - B - C !
45
I T ’ S A S E A S Y A S A - B - C !
“AK,AL,AR,AS,AZ,CA”
46
I T ’ S A S E A S Y A S A - B - C !
47
I T ’ S A S E A S Y A S A - B - C !
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.
49
I T ’ S A S E A S Y A S A - B - C !
Basic,Detailed,Photo
VOILA!
50
I T ’ S A S E A S Y A S A - B - C !
51
I T ’ S A S E A S Y A S A - B - C !
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!
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 !
1. Exit abcDB
2. Cradle your
PocketPC and make
sure ActiveSync is
connected
53
I T ’ S A S E A S Y A S A - B - C !
54
I T ’ S A S E A S Y A S A - B - C !
55
I T ’ S A S E A S Y A S A - B - C !
56
I T ’ S A S E A S Y A S A - B - C !
57
I T ’ S A S E A S Y A S A - B - C !
xSysABCForm
xSysABCForms2
xSysABCObjects
xSysABCQueries
58
I T ’ S A S E A S Y A S A - B - C !
How do we do that?
59
I T ’ S A S E A S Y A S A - B - C !
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.
60
I T ’ S A S E A S Y A S A - B - C !
THERE!
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
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.
Forms are made up of a variety of controls. Currently, abcDB™ supports the following
controls (See Appendix D for details on each control)
62
I T ’ S A S E A S Y A S A - B - C !
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:
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.
~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 !
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:
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()
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.
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:
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:
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:
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:
However, if your ID field was a TEXT or a MEMO field, then you'd do this:
If you have a date field, then you need to surround the value with ##'s like this:
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 …
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 !
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.
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.
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 !
70
I T ’ S A S E A S Y A S A - B - C !
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.
71
I T ’ S A S E A S Y A S A - B - C !
First, close this form, and then EDIT it. Meet you on the
next step.
72
I T ’ S A S E A S Y A S A - B - C !
MESSAGE(“HELLO “ ~NAME~//”abcDB”)
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!
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.)
City Text 50
State Text 50
Style Text 50
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
Style Text 50
Price Currency
Taxes Currency
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 !
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.
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:
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.
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 !
butAddress:
GRIDREFRESH(“SELECT ID,Price,Style,
address,StreetAve,StreetType,City FROM
tblListings WHERE Address LIKE
‘%”~ADDRESS~”%’”// // //”---“// // //)
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 !
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.
No problemo! Let’s edit our form again, and I’ll meet you at the
next step….
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 !
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.
After you save your form, you can see it works pretty slick! But
our SHOW HOUSE button still doesn’t do anything.
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 !
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.
82
I T ’ S A S E A S Y A S A - B - C !
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)
SETMEM(IMAGE//1)
SCRIBCLEAR()
SCRIBSAVE()
83
I T ’ S A S E A S Y A S A - B - C !
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.
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.
85
I T ’ S A S E A S Y A S A - B - C !
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?
Now, let’s add the following line of code to the bottom of our
GRID’s ON CURRENT event:
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 !
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.
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.
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!
Notice how the PowerPick has now filled in our CITY textbox with
the value I chose.
PowerPick’s save your user time, and they make data entry more
accurate with fewer spelling errors.
88
I T ’ S A S E A S Y A S A - B - C !
FORMOPEN("frmSEARCH"// //1//"---"////)
FORMOPEN("frmListings"// //1//"---"////)
EXITAPP()
89
I T ’ S A S E A S Y A S A - B - C !
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’.
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~ “.”)
PLAYSOUND(“/My Documents/MySound.wav”//1)
For now, let’s SAVE our form and we’ll test it out.
SETVALUE(~DISPLAY~//eval(~DISPLAY~))
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 !
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.
So you can see from this little exercise some more evidence
that abcDB truly is a powerful ‘mobile’ programming
language!
Before we begin building the FORM though, let’s create the necessary tables.
AreaCode Text 6
92
I T ’ S A S E A S Y A S A - B - C !
County Text 25
FullStateName Text 30
Capitol Text 14
State Text 2
Now that we have our tables setup, let’s create our form:
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 !
Open the PROPERTIES for the GRID control, and enter the
following:
SQL Property:
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 !
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!
95
I T ’ S A S E A S Y A S A - B - C !
96
I T ’ S A S E A S Y A S A - B - C !
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!
Make sure that the textbox bound to the CITY field is given
a TAGNAME value of CITY.
But let’s open the FORM properties, and go to the next step.
98
I T ’ S A S E A S Y A S A - B - C !
Now, choose the tblListings table, and then select ALL the
fields (ie. The *)
99
I T ’ S A S E A S Y A S A - B - C !
OK!
THERE!
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.
:1:Address
:1:StreetAve
:1:StreetType
:1:City
:1:State
100
I T ’ S A S E A S Y A S A - B - C !
We’ve got the top two textboxes displaying data from our
tblCities table.
101
I T ’ S A S E A S Y A S A - B - C !
102
I T ’ S A S E A S Y A S A - B - C !
5. As you can see here, I’ve also done the same with
my labels.
HOORAY! It works!
Why?
103
I T ’ S A S E A S Y A S A - B - C !
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!
Cool!
It works!
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 !
So, edit your form again, and open your FORM properties.
SETVALUE(~RECORDNO~//POSITION(1))
When you’re done, save your changes, and try running the
form again.
EXCELLENT!
105
I T ’ S A S E A S Y A S A - B - C !
6
Chapter
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 …
106
I T ’ S A S E A S Y A S A - B - C !
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
107
I T ’ S A S E A S Y A S A - B - C !
And it worked!
108
I T ’ S A S E A S Y A S A - B - C !
109
I T ’ S A S E A S Y A S A - B - C !
- Customers
- Inventory
- Receivables
- Vendors
110
I T ’ S A S E A S Y A S A - B - C !
111
I T ’ S A S E A S Y A S A - B - C !
112
I T ’ S A S E A S Y A S A - B - C !
113
I T ’ S A S E A S Y A S A - B - C !
114
I T ’ S A S E A S Y A S A - B - C !
115
I T ’ S A S E A S Y A S A - B - C !
It worked!
116
I T ’ S A S E A S Y A S A - B - C !
7
Chapter
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.
117
I T ’ S A S E A S Y A S A - B - C !
118
I T ’ S A S E A S Y A S A - B - C !
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 !
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 !
121
I T ’ S A S E A S Y A S A - B - C !
Let’s move to the next step, and we’ll see what this
form looks like when we run it on the device.
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
123
I T ’ S A S E A S Y A S A - B - C !
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:
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).
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).
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
ID Increment Integer field that abcDB™ will automatically populate with the next highest
ID number.
ID Random Integer field that abcDB™ will automatically populate with a random ID
number
ID GUID Text field (at least 50 wide) that abcDB™ will automatically populate with
a GUID (Globally Unique Identifier)
Date/Time
129
I T ’ S A S E A S Y A S A - B - C !
130
I T ’ S A S E A S Y A S A - B - C !
B
Appendix
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
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.
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.
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.
tablename
The name of the table from which to retrieve data.
fieldname-expression
Can take one of the following forms:
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.
• IN is 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
tablename
The name of the table from which to retrieve data.
RETURN VALUES
• 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.
135
I T ’ S A S E A S Y A S A - B - C !
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.
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.
An SQL statement cannot be longer than 2,048 characters. A longer statement causes an error.
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.
137
I T ’ S A S E A S Y A S A - B - C !
tablename
The name of the table to delete.
RETURN VALUES
• 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.
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
• 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
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.
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 !
Example:
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:
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:
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:
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~)
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.
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.
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’:
146
I T ’ S A S E A S Y A S A - B - C !
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:
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.
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.
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 !
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.
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.
IMAGE(LOAD//"/My Documents/MyPic.BMP")
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.
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 !
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
POWERPICK
This function will display a picklist allowing the user to rapidly select a value.
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 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
PRINT(1)
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
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 !
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:
RUNUPDATE
Updates the specified field with the value chosen.
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 !
SCRIBCLEAR
This function clear the contents of the scribble control.
SCRIBCLEAR(tag)
PARAMETERS
TAG
The tagname of the scribble control you wish to clear
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.
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)
SETMEM
This function will create/set a memory variable.
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
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
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.
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 !
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.
PARAMETERS
Enabled OR Interval
Enter ENABLED or INTERVAL
TRUE/FALSE or INTERVAL
Enter either TRUE or FALSE … OR the Interval (1000 = 1 second)
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.
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 !
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
FORM
Every abcDB™ ‘FORM’ has it’s own properties and events.
The abcDB™ FORM supports the following properties.
SQL The SQL statement that is used to ‘populate’ all the controls on this form.
Ie.
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.
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.
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.
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.
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.
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.
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 !
= ~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
Font Size The SIZE of the font this textbox will use.
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~.
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*
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™)
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
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 !
= ~TEXTBOX1~ * .07
Font Size The SIZE of the font this DROPDOWN will use.
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~.
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 !
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™)
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.
Font Size The SIZE of the font this LABEL will use.
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.
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*
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
Font Size The SIZE of the font this COMMAND Button will use.
175
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 COMMAND Button.
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*
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
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’
Default This property determines the default value that will be used to populate this
CHECKBOX whenever a new record is added.
176
I T ’ S A S E A S Y A S A - B - C !
Font Size The SIZE of the font this CHECKBOX will use.
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~.
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*
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 !
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.
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
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.
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.
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.
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*
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.
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 ~.
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™)
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
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.
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~.
180
I T ’ S A S E A S Y A S A - B - C !
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*
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.
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.
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*
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.
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.
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.
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
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:
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.
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..
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.
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 !
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 !
GPSSPEED
This function will return your current SPEED from your GPS.
Note that this function returns speed in Knots.
GPSSPEED()
PARAMETERS
NONE
EXAMPLE:
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 !
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.
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.
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.
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.
MID
This function retains a specified number of characters from a string and removes the
remaining characters.
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.
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:
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 !
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
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.
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 !
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.
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.
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.
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.
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()
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 !
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
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.
209
I T ’ S A S E A S Y A S A - B - C !
210
I T ’ S A S E A S Y A S A - B - C !
211
I T ’ S A S E A S Y A S A - B - C !
212
I T ’ S A S E A S Y A S A - B - C !
213
I T ’ S A S E A S Y A S A - B - C !
214
I T ’ S A S E A S Y A S A - B - C !
215
I T ’ S A S E A S Y A S A - B - C !
216
I T ’ S A S E A S Y A S A - B - C !
Not quite.
Let’s see …
217
I T ’ S A S E A S Y A S A - B - C !
218
I T ’ S A S E A S Y A S A - B - C !
PocketPC.
219
I T ’ S A S E A S Y A S A - B - C !
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
If (CoCreateGuid(udtGUID) = 0) Then
GetGUID = _
221
I T ’ S A S E A S Y A S A - B - C !
End If
End Function
222
I T ’ S A S E A S Y A S A - B - C !
G
Appendix
This web page assumes you have successfully installed the 'client' portion of abcDB™
Wireless to your device.
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.
Remote users > Internet > abcDB™-dbBridge Application Server > Databases
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
230
I T ’ S A S E A S Y A S A - B - C !
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.)
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.
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.
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.
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.
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").
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.
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.
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.
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.
234
I T ’ S A S E A S Y A S A - B - C !
Open the ODBC Data Source Administrator - Start > Settings > Control Panel > ODBC
Data sources
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 !
Open the ODBC Data Source Administrator - Start > Settings > Control Panel > ODBC
Data sources
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.
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 !
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:
239
I T ’ S A S E A S Y A S A - B - C !
Allow COUNT ON
Allow UPPER ON
240
I T ’ S A S E A S Y A S A - B - C !
H
Appendix
241
I T ’ S A S E A S Y A S A - B - C !
242
I T ’ S A S E A S Y A S A - B - C !
243
I T ’ S A S E A S Y A S A - B - C !
Let’s click OK …
244
I T ’ S A S E A S Y A S A - B - C !
245
I T ’ S A S E A S Y A S A - B - C !
I
Appendix
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 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:
If you make ANY changes to a form and/or query, you'll need to repeat
steps 3-5.
247
I T ’ S A S E A S Y A S A - B - C !
J
Appendix
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 !
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
W
ith the release of abcDB v5.0, it was possible to retrieve data from connected GPS
(Global Positioning System) receivers.
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)
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:
Latitude
longitude
altitude
Time
Speed
MaxSpeed
MaxAlt
GPSOK
AltUnits
252
I T ’ S A S E A S Y A S A - B - C !
GPSOPEN(“4”//”4800,N,8,1”)
gpsinit("$PRWIILOG,RMC,A,T,2,0"//"$PRWIILOG,
GGA,A,T,2,0"//"$PRWIILOG,ZCH,V,,,")
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())
GPSCLOSE()
253
I T ’ S A S E A S Y A S A - B - C !
254
I T ’ S A S E A S Y A S A - B - C !
L
Appendix
255
I T ’ S A S E A S Y A S A - B - C !
"TITLE"
"WEBPAGE"
"YOMICOMPANYNAME"
"YOMIFIRSTNAME"
"YOMILASTNAME"
TASKS COLLECTION
CALENDAR COLLECTION
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
257
I T ’ S A S E A S Y A S A - B - C !
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 !
263
I T ’ S A S E A S Y A S A - B - C !
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