Page 1
Page 2
Page 3
Page 4
Page 5
Listing 2 - SQL
Server CE Data Types2
| SQL Server CE data type |
OLE DB data type |
OLE DB properties |
SQL Server CE specifics |
| BIGINT |
DBTYPE_18 |
|
|
| BINARY |
DBTYPE_BYTES |
DBPROP_COL_
FIXEDLENGTH=
VARIANT_TRUE |
|
| BIT |
DBTYPE_BOOL |
|
|
| DATETIME |
DBTYPE_ DBTIMESTAMP
|
|
Valid year range 1753-9999; valid second range
0-59 |
| DOUBLE PRECISION |
DB_TYPE_R8 |
|
|
| FLOAT |
DBTYPE_R8 |
|
|
| IMAGE |
DBTYPE_BYTES |
|
|
| INTEGER |
DBTYPE_I4 |
|
|
| MONEY |
DBTYPE_CY |
|
|
| NATIONAL CHARACTER |
DBTYPE_WSTR |
DBPROP_COL_
FIXEDLENGTH = VARIANT_TRUE |
|
| NATIONAL CHARACTER VARYING |
DBTYPE_WSTR |
DBPROP_COL_
FIXEDLENGTH = VARIANT_FALSE |
|
| NTEXT |
DBTYPE_WSTR |
|
|
| NUMERIC |
DBTYPE_NUMERIC |
|
|
| REAL |
DBTYPE_R4 |
|
|
| SMALLINT |
DBTYPE_I2 |
|
|
| UNIQUE-IDENTIFIER |
DBTYPE_GUID |
|
|
| TINYINT |
DBTYPE_UI1 |
|
|
| VARBINARY |
DBTYPE_BOOL |
DBPROP_COL_
FIXEDLENGTH = VARIANT_FALSE |
|
The Code
Now that the background and foundation have
been established, it's time for the fun to begin - CODING! Figure
2 shows a screen shot of the application included in the sample
code. It is an SSCE Database viewer that was written for this
article. It isn't production code, but more of an example of how
to use ADOXCE to view database information.
Start the project by opening embedded Visual
Basic (eVB) and selecting the project template named 'Windows
CE for the Pocket PC project'. Once the basic project template
is loaded, a reference to Microsoft CE ADO Ext. 3.1 for DDL should
be set (see Figure 3). While not entirely needed to use ADOXCE,
the reference does allow for ADO constants to be used and the
use of strongly typed variables in the project.
If this is the first project created using
SSCE, Microsoft CE SQL Server Control 1.0 and Microsoft CE ADO
Control 3.1 should also be selected. Also make sure to have the
project Properties set like Figure 4. That will ensure that the
SSCE files get copied to the machine when the project is run from
eVB. The Remote Path can also be changed. This will affect where
the project puts files on the target when the project is run from
the IDE. The Frequency Drop down can be changed to Always, forcing
eVB to copy the latest required files to the target.
2 SQL Server
CE Books Online, Copyright 2000 Microsoft Corporation
Previous
Page Next Page
Previous Page
Next Page