This page provides the information required for Server Setup and the CyberTracker Command-Line.
A CyberTracker database is normally a Microsoft Access database or .MDB file. This is convenient because a single file can hold the entire database. However, only one user can connect at a time and the database size is limited to 2 GB.
CyberTracker supports connections to Server databases such as MySQL, Microsoft SQL Server and PostgreSQL. This is done using a connection file, which tells CyberTracker how to communicate with the server.
Installing and configuring MySQL
Download and install MySQL
Version 5.1 is recommended.
Add the following line to \MySQL\MySQL Server 5.1\my.ini:
max_allowed_packet = 64M
Download and install MySQL Connector
Installing and configuring PostgreSQL
Download and install PostgreSQL from http://www.postgresql.org/download.
When installing, also install the ODBC driver (or download and install it separately from here https://odbc.postgresql.org/).
In the PostgreSQL console, create a new database.
In CyberTracker, use the Tools->Create database connection option to set up a connection in the usual way. Don't forget to set the type rules to "PostgreSQL".
Examine the resulting EDB file and make sure that ByteaAsLongVarBinary=1.
Creating a connection
CyberTracker supports connecting to a database via an EDB (External Database) file. An EDB file is an XML file that tells CyberTracker how to connect to the database. Here is an example EDB file:
TypeRules specifies how to treat data types. Acceptable values are "MySQL" and "SQL Server". This is to handle differences in SQL database types.
User ID and Password should be set according to your credentials.
Data Source is the name of a User Data Source as configured by the windows "ODBC Data Source Administrator". This tool binds a database driver to a data source so that applications can access it easily. The tool can be run by using Start->Run and typing "odbcad32.exe". Make sure that an ODBC driver is available for your database before setting this up. For MySQL, this is the MySQL Connector.
Initial Catalog is the name of the database. This database can be created using the "CREATE DATABASE MyDatabaseName" SQL command.
Converting an existing database
Once you can successfully connect to the server database by opening the .EDB file (using File->Open from the CyberTracker main menu), the next step is to import an existing database. The most common way to do this is:
• Load the old MDB database, using File->Open
• Export it to a CTX file, using File->Export
• Open the new EDB database, using File->Open
• Import the CTX file, using File->Import
• Save the new database
Multiple simultaneous connections
By distributing the EDB file within your organization, multiple users can connect to the database simultanously. This has 2 implications to be aware of:
1. As new sightings come in from remote sources, users will need to press "F5" (or use Edit->Refresh) to see new sightings
2. Conflicts may arise if multiple users are making changes to the same database. To restrict this, end-users should not use the "Studio" version when viewing data. In all cases, the most recently saved data wins.
Using Export Data Tables
An Export Data Table is a table in a database that holds captured sighting data in an exported tabular form.
In order to view sighting data within CyberTracker, it is 'projected' onto a table. This simply means that each sighting attribute is mapped to a column. This table is a very natural way to view and query the data.
CyberTracker has the ability to export the Query View table to a database table. However, doing this requires some setup: the table must already be created in the target database and must have certain pre-defined fields.
To get started, create a table in your database named "Export" with the following SQL command:
CREATE TABLE Export (ID CHAR(38) NOT NULL UNIQUE, Date DATE, Time TIME, Latitude DOUBLE, LONGITUDE DOUBLE, Note LONGTEXT)
1. Load CyberTracker and open a report with sightings
2. With the Query Editor selected, click on the "Export View" button
3. In the "Save As Type" drop down, select "External database" and select the database you want to export to
4. Click Okay. Note you will get a message about overwriting this file, but it can be ignored (the .EDB file will not be overwritten, but duplicate data in the "Export" table will be)
Finally, use the following SQL command to see the data in the "Export" table in the database:
SELECT * FROM Export
Here is the list of field names (and their associated types) which CyberTracker recognizes specially:
Id: CHAR(38) NOT NULL UNIQUE - The primary Id of the sighting. This must be indexed for merging reasons.
DeviceId: CHAR(38) - The Id of the device used to capture the observation. This can be used to group sightings created by a single observer.
Deleted: SMALLINT - Whether or not the sighting has been deleted. Using this field allows deleted sightings to be correctly merged.
The UI component of this feature is designed mainly for experimentation. It can be more fully controlled via the CyberTracker Command-Line (below).
CyberTracker matches fields by name, so the column name in CyberTracker must be the same as the field name in the table to work correctly. Column names can be changed using the "View Properties" dialog.
Several CyberTracker features can be triggered via the command-line. This functionality is usually intended for server side scripts that operate on the database as a whole. To use the command line, use:
cd "\Program Files\CyberTracker Software\CyberTracker 3.0"
Note, do not use "ct3.exe /?", because this will trigger the windows application. Instead, just type "ct3".
"System" folders are mentioned below. These are sub-folders of "Documents\My CyberTracker Databases\System". This folder can be opened in Explorer to see the way data moves through the system.
Data that is waiting to be inserted into a database is placed into this folder. This folder is processed by CyberTracker routinely, e.g. on startup, on sync, etc. If the data cannot be uploaded into the target database for any reason, it will remain in this folder - potentially indefinitely.
Once data has been successfully added to a database, it is moved to this folder. If the database later becomes corrupt, it acts as a second line of defense.
If CyberTracker crashes, the changes that have been made since the last save are exported to a CTX file and placed here.
When files are downloaded from the internet, they are temporarily held in this location.
CyberTracker keeps a log of all sync operations. Check out the download.txt file in this location to understand errors. This only affects ActiveSync and Hotsync operations.
Virtual Earth tiles that are downloaded from the server are placed here to improve performance.
Once files have been downloaded via a local sync (ActiveSync or Hotsync), they may need to ultimately be sent to an internet server. Check out the "Send on Sync" option on the "Database Properties" dialog. This is a holding location for them before they are processed.
Local system settings, e.g. the current Client Profile.
Connect to the a Windows Mobile / PocketPC PDA and download any data that is on it. As soon as data is downloaded from the PDA, it is placed in the Staging (see above) folder.
Use the download settings of the associated /Database to connect to a URL. Incoming data is placed in the Staging (see above) folder. If an /ExportDatabase, /ExportRule and /ExportTable are also specified, then this downloaded data will be exported.
Process the Outgoing (see above) folder.
Specify a data file (.CTX) for use with data operations, for example as an input for the /ExportTable mechansim. If the full path is not present, the system will attempt to locate the file in "Documents\My CyberTracker Databases".
Specify the database to use for data operations, for example as an input for the /ExportTable mechanism.
The export rule file. The export rule file can be created by using the "Export View" toolbar button with the "Query Editor" active. Use the "Save as type" drop down on the File Save dialog to select "Export Rule File".
The target database for export operations. Must be accompanied by a /ExportRule and /ExportTable. The input for this operation comes from a /Datafile, /Database or /DownloadURL command. If the full path is not present, the system will attempt to locate the file in "Documents\My CyberTracker Databases".
The table name in the target database. This table must already exist and be properly configured. See "Using Export Data Tables" in CyberTracker Server Setup.
Turn on all CyberTracker features and run the desktop application.
ct3 /Database mydb.mdb /DownloadURL
Open the database mydb.mdb, get the download settings and execute a download using the parameters in the "Database Properties" dialog. This is equivalent to clicking the "Download" button on the "Database Properties" dialog box.
Download all data from the currently connected Windows Mobile device.
ct3 /Database myin.edb /DownloadUrl /ExportDatabase myout.edb /ExportRule myrule.exr /ExportTable mytable
Open the database myin.edb and get the download settings. Download all the files available using the parameters in the "Database Properties" dialog. Export this data to the myTable table in the myout.edb database. Note, myin.edb and myout.edb can be the same database.
Using this method is the preferred way of configuring a schedule task that keeps an export table up to date, because only the newly downloaded data is considered for export.