Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
width30px

Insert excerpt
US:_icon_C(30px)
US:_icon_C(30px)
nopaneltrue

Column
Insert excerpt
US:_xc_GettingStarted_Case_01
US:_xc_GettingStarted_Case_01
nopaneltrue

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
languagecpp
titleDelete 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
languagecpp
titleCreate 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
languagecpp
titleOpen 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.