...
The complete package with resource files and source code is available from Getting Started, but you may also download the source code of the sample below.
Section |
---|
Column |
---|
| Insert excerpt |
---|
| US:_icon_C(30px) |
---|
| US:_icon_C(30px) |
---|
nopanel | true |
---|
|
|
Column |
---|
Insert excerpt |
---|
| US:_xc_GettingStarted_Case_01 |
---|
| US:_xc_GettingStarted_Case_01 |
---|
nopanel | true |
---|
|
|
|
In the following, we will walk you through all the statements and explain them.
Creating the EDMdatabase
When your application is a EDMstandaloneClient, you will create and operate on the EDMdatabase locally. The first you need to do is to create this database (unless you already have one on your file system). This sample assumes that there is already an EDMdatabase on your file system, created by your previous run, and that you will delete it first.
Code Block |
---|
language | cpp |
---|
title | Delete EDMdatabase |
---|
|
if (rstat = edmiDeleteDatabase (dbPath, dbName, dbPwd)) {
if (rstat != edmiENOSUCHDATABASE) {
printf("\nERROR: Failed to delete database with error '%s'", edmiGetErrorText(rstat));
goto err;
}
} |
The EDMdatabase will consist of a great number of files, so make sure you create a separate folder for it.
Code Block |
---|
language | cpp |
---|
title | Create EDMdatabase |
---|
|
if (rstat = edmiCreateDatabase (dbPath, dbName, dbPwd)) {
printf("\nERROR: Failed to create database with error '%s'", edmiGetErrorText(rstat));
goto err;
} |
After creating the EDMdatabase, you will have typically 50 files in your database folder. Any standalone process can open and connect to this EDMdatabase once it is created, but only one process can open it at the time. If you need multiple client applications connect to the EDMdatabase simultaneously, you need an EDMserver and write your application as an EDMthinClient.
Code Block |
---|
language | cpp |
---|
title | Open EDMdatabase |
---|
|
if (rstat = edmiOpenDatabase(dbPath, dbName, dbPwd)) {
printf("\nERROR: Failed to open database with error '%s'", edmiGetErrorText(rstat));
goto err;
} |
The EDMdatabaseis now open and therefore uavailable to other EDMclient applications.