Opens an existing EDMdatabase and attach the actual EDMdatabase to the EDMserver used by the caller. An EDMdatabase must be open before any access to the database is permitted.
In a single-user system the EDMserver is embedded in the EDMinterface, in a multi-user system the EDMserver is running as a separate process on the same system or on another system than the caller.
One EDMserver can handle only one single EDMdatabase at a time, i.e. the currently opened database must be closed before another one can be opened.
This operation is protected with a password. This password is defined when the actual EDMdatabase is created.
Related functions: edmiCloseDatabase , edmiCreateDatabase .
Header:
#include "sdai.h"
Prototype:
EdmiError edmiOpenDatabase(SdaiString location,
SdaiString databaseName,
SdaiString password);
Arguments:
location |
Specifies the path to the directory where the database is located. The <location> must be specified as an absolute of the actual EDMserver. |
databaseName |
Specifies the name of the EDMdatabase to open. EDMdatabase names are case sensitive on the UNIX platforms and case insensitive on the Windows platforms. |
password |
Specifies the password for the actual database. The password for the database is defined by the edmiCreateDatabase function. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiSession sessionId;
. . .
if (rstat = edmiOpenDatabase ("/usr/EDM/databases/",
"Ship",
"hkd")) {
/* Error in operation */
printf("\nError: %s in edmiOpenDatabase \n",
edmiGetErrorText(rstat));
goto error;
}
sessionId = sdaiOpenSession();
if (! sessionId) {
/* Error in operation */
printf("\nError: %s in sdaiOpenSession\n",
edmiGetErrorText(rstat));
goto error;
}
. . .