Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


 
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.
The <location> > argument can be specified with and without the directory delimiter character as the last character in the directory path. The directory delimiter character is '\' on the Windows platforms and '/' on the Unix platforms.

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; 
}
. . .

  • No labels