Connect to CDB#
C: |
Fortran: |
character FileName(*)
In: In: integer Index
integer index = ReturnValue
Connect to CDB where the FileName
is the path of the CDB (.cdb
). It becomes the
active database. This function has to be called before any other activity is allowed. In the
‘’CDBase Help’’ description there are few Index options available.
In the examples Index=99 is used where it checks if FileName
is a valid database and
opens it if possible with the assigned index. If the CDB doesn’t exist it will be created.
Parameters
FileName
is
a valid database and opens the database if possible. If file does not
exists it will be created.The return values of Index are very important to handle the CDB. In our example it is necessary that the index return value must be > 0 because if the return value is < 0 it means that we have an error while trying to connect to the CDB. If we use Index = 99 and get a return value = 0, it means that the connected file is not a CDB.
The configured examples uses ‘’non-license requesting’’ DLLs. So you don’t need to have a
SOFiSTiK license to read the data from the CDB (cdb_w31.dll
and sof_cdb_w-2023.dll
).
Warning
Note that this code won’t work if the environment and the DLL location isn’t set. You can print out the Index return value to check if the CDB connected successfully.
An example how to connect to the CDB is given in specific programming languages parts of this manual, depending on the programming language that is used.
Value |
Description |
---|---|
|
unknown error |
|
path not found |
|
Name not valid |
|
file not found |
|
no permission to create file |
|
too many open files |
|
no permission to write file |
|
wrong CDBase-Version |
|
file is no CDBase-file |