CodeBase Database Errors

The following error codes that are returned by the EBMS CodeBase database engine when an error has occurred. The tables display the integer constants and the corresponding small error descriptions accompanied by a more detailed explanation.

Constant Name





Closing File

An error occurred while attempting to close a file.



Creating File

This error could be caused by specifying an illegal file name, attempting to create a file that is open, having a full directory, or by having a disk problem.


Refer to the Code4::safety and Code4::errCreate flags in the Code4 chapter of this manual for more information on how to prevent this error from occurring. 


This error also results when the operating system doesn't have enough file handles. See e4numFiles, below, for more information. 



Determining File Length

An error occurred while attempting to determine the length of a file. This error occurs when CodeBase runs out of valid file handles. See e4numFiles, below, for more information.



Setting File Length

An error occurred while setting the length of a file. This error occurs when an application does not have write access to the file or is out of disk space.



Locking File

An error occurred while trying to lock a file. Generally this error occurs when the Code4::lockEnforce member variable is set to true (non-zero) and an attempt is made to modify an unlocked record. This error can also occur when File4::lock is called more than once for the same set of bytes without calling File4::unlock between the calls toFile4::lock.



Opening File

A general file failure occurred opening a file. This error will be generated if there is not enough information to generate any of theÔÇæ6x errors listed below (i.e. the compiler or operating system does not allow for distinguishing between various file errors).



Permission Error Opening File

Permission to open the file as specified was denied. For example, another user has the file opened exclusively.



Access Error Opening File

Invalid open mode was specified. This would usually occur if there was a discrepancy between CodeBase and the implementation on a compiler or operating system (i.e. a compatibility problem).



File Handle Count Overflow Error Opening File

The maximum file handle count was exceeded.



The number of file handles available to an application or DLL is determined in the 'startup' code of the 'C' run-time library that the application or DLL is linked with.


The pre-built CodeBase DLL uses the multi-thread run-time libary, which supports up to 256 file handles.



The server executable has been built with modified run-time libraries that support up to 255 file handles being available. Therefore, this error is unlikely to occur in client-server applications, where the server is opening all files. If this error does occur in a client-server application, you must modify your application to use less files at any given time. 



File Find Error Opening File

File was not found as specified.



Duplicate Instance Found Error Opening File

An attempt to open a duplicate instance of a file has been denied. The Code4::singleOpen setting influences how duplicate accessing of a file from within the same executable is performed. This error indicates one of two possibilities:

1.      An open request has occurred but an active data handle in the same executable is inhibiting the open.



2.    In a client-server configuration, a different client application has explicitly requested and has been granted exclusive client-access to the specified file. 



Reading File

An error occurred while reading a file. This could be caused by calling Data4::go with a nonexistent record number.



Removing File

An error occurred while attempting to remove a file. This error will occur when the file is opened by another user or the current process, and an attempt is made to remove that file.



Renaming File

An error occurred while renaming a file. This error can be caused when the file name already exists.



Unlocking File

An error occurred while unlocking part of a file. This error can occur when an attempt is made to unlock bytes that were not lockedwith File4::lock.



Writing to File

This error can occur when the disk is full.

Data File Specific Errors

Constant Name





File Is Not a Data File

This error occurs when attempting to open a file as a .DBF data file when the file is not actually a true data file. If the file is a data file, its header and possibly its data are corrupted.



Unrecognized Field Name

A function, such as Data4::field, was called with a field name not present in the data file.



Unrecognized Field Type

A data field had an unrecognized field type. The field type of each field is specified in the data file header.



Record Length Too Large

The total record length is too large. The maximum is USHRT_MAX-1, which is 65534 for most compilers.



Record Append Attempt Past End of File




This error can occur if Data4::seek(double) tries to do a seek on a non-numeric tag.

Index File Specific Errors

Constant Name





Tag Entry Missing

A tag entry was not located. This error occurs when a key, corresponding to a data file record, should be in a tag but is not.



Not a Correct Index File

This error indicates that a file specified as an index file is not a true index file. Some internal index file inconsistency was detected.



Tag Name Not Found

The tag name specified is not an actual tag name. Make sure the name is correct and that the corresponding index file is open.



Unique Key Error

An attempt was made to add a record or create an index file that would have resulted in a duplicate tag key for a unique key tag. In addition, Tag4::unique returned e4unique, or when creating an index file, thememberTAG4INFO::unique specified e4unique.



Tag information Is Invalid

Usually occurs when calling Data4::create orIndex4::create with invalid information in the input TAG4INFO structure.

Expression Evaluation Errors

Constant Name





Comma or Bracket Expected

A comma or a right bracket was expected but there was none. For example, the expression "SUBSTR( A" would cause this error because a comma would be expected after the 'A'.



Expression Not Complete

The expression was not complete. For example, the expression "FIELD_A +" would not be complete because there should be something else after the '+'.



Data File Name Not Located

A data file name was specified but the data file was not currently open. For example, if the expression was "DATA->FIELD_NAME", but no currently opened data file has "DATA" as its alias. Refer toData4::alias.



IIF() Needs Parameters of Same Length

The second and third parameters of database function IIF() must resolve to exactly the same length. For example, IIF( .T., "12", "123" ) would return this error because character expression "12" is of length two and "123" is of length three.



SUBSTR() and STR() Need Constant Parameters

The second and third parameters of functions SUBSTR() and STR() require constant parameters. For example, SUBSTR( "123", 1, 2 ) is fine; however, SUBSTR( "123", 1, FLD_NAME ) is not because FLD_NAME is not a constant.



Number of Parameters Is Wrong

The number of parameters specified in a database expression is wrong.



Overflow While Evaluating Expression

The database expression was too long or complex for CodeBase to handle.

The parsing algorithm limits the number of comparisons made in a query. Thus, very long expressions can not be parsed. UseCode4::calcCreate to 'shorten' the expression.



Right Bracket Missing

The database expression is missing a right bracket. Make sure the expression contains the same number of right as left brackets.



Sub-expression Type Is Wrong

The type of a sub-expression did not match the type of an expression operator. For example, in the expression "33 .AND. .F.", the "33" is of type Numeric and the operator ".AND." needs Logical operands.



Unrecognized Function

A specified function was not recognized. For example, the expression "SIMPLE(3)" is not valid.



Unrecognized Operator

A specified operator was not recognized. For example, in the database expression "3 } 7", the character '}' is in a place where a database operator would be expected.



Unrecognized Value

A character sequence was not recognized as a database constant, field name, or function.

Could be an bad validation in security. Try a user with different permissions. Check the Advanced Security



Unterminated String

According to database expression syntax, a string constant starts with a quote character and ends with the same quote character. However, there was no ending quote character to match a starting quote character.



Expression Invalid for Tag

The expression is invalid for use within a tag. For example, although expressions may refer to data aliases, tag expressions may not. This error usually occurs when specifying TAG4INFO expressions when callingData4::create or Index4::create and the TAG4INFOcontains an invalid key or filter expression.

Optimization Errors

Constant Name





Optimization Error

A general CodeBase optimization error was discovered.



Optimization Removal Error

An error occurred while suspending optimization.



Optimization File Flushing Failure

An error occurred during the flushing of optimized file information.

Relation Errors

Constant Name





Relation Error

A general CodeBase relation error was discovered.



Matching Slave Record Not Located

CodeBase could not locate the master record's corresponding slave record.



Relation Referred to Does Not Exist or Is Not Initialized

Referenced a non-existent or improperly initialized relation. Possible cases are: non-initialized memory or an invalid pointer has been passed to a relate module function, orfunction calls have occurred in an invalid sequence (for example, Relate4set::skipmay not be called unless Relate4set::tophas previously been called).

Severe Errors

Constant Name





Unexpected Information

CodeBase discovered an unexpected value in one of its internal variables.



Out of Memory

CodeBase tried to allocate some memory from the heap, in order to complete afunction call, but no memory was available.



This usually occurs during a database update process, which happens when a record is appended, written or flushed to disk. During the update, if a new tag block is required, CodeBase will attempt to allocate more memory. If the memory is not available, CodeBase will return the "Out of Memory" error. If this error occurs during the updating process, the index file will most likely become corrupt. It is virtually impossible to escape this error so it is advantageous to allocate all the memory required before any updates are made. Set Code4::memStartBlock to the maximum number of blocks required before opening any index files. See the "Frequently Asked Questions" document for more details. 



Unexpected Parameter

A CodeBase function was passed an unexpected parameter value. This can happen when the application programmer forgets to initialize some pointers and thus null pointers are passed to a function.



Null Input Parameter unexpected

Unexpected parameter - null input.



Exceeded Maximum Record Number for Demonstration

Exceeded maximum support due to demo version of CodeBase.



Unexpected Result

A CodeBase function returned an unexpected result to another CodeBase function.



Structure Verification Failure

Unexpected result while attempting to verify the integrity of a structure.



Data Structure Corrupt or Not Initialized

CodeBase internal structures have been detected as invalid.

Not Supported Errors

Constant Name





Library Compiled with S4OFF_INDEX

An attempt was made to call one of the indexing functions but the library was compiled without them.



Library Compiled with S4OFF_MEMO

An attempt was made to call one of the memo functions but the library was compiled without them.



Library Compiled with S4OFF_WRITE

An attempt was made to write to a file but the library was compiled without this capability.



Function Unsupported: Library Compiled with S4CLIPPER

Function not supported in S4CLIPPERimplementation.



Function Unsupported

Operation generally not supported



Application/Library Version Mismatch

Version mismatch (e.g. client version mismatches server version).

Memo Errors

Constant Name





Memo File Corrupt

A memo file or entry is corrupt.



Error Creating Memo File

For example, Code4::memSizeMemo is set to an invalid value.

Transaction Errors

Constant Name





Transaction Violation Error

Attempt to perform an operation that is disallowed within a transaction. (e.g.Data4::packData4::zap, etc.)



Transaction Error

Transaction failure. A common occurrence is if the transaction file is detected to be in an invalid state upon opening.



Transaction Rollback Failure

An unrecoverable failure occurred while attempting to perform a rollback (e.g. a hard disk failure)



Transaction Commit Failure

Transaction commit failure occurred.



Error Appending Information to Log File

An error has occurred while attempting to append data to the transaction log file. One possible reason is running out of disk space. In the client-server configuration, all clients will likely be disconnected and the server will shut down after this failure.

Communication Errors

Constant Name





Communication Information Corrupt

Corrupted connection information generally would indicate a netowrk hardware/software failure of some type. For example, out of date network drivers might be installed on a client or a server machine. Alternatively, the client application might have been compiled with an unsupported compiler, using unsupported compiler switches, or under an unsupported operating system, resulting in perceived network problems.



Connection Failure

For example, a connection failed to be established or got terminated abruptly by the network.



Socket Failure

All CodeBase software use sockets as their basis for communications. This error indicates a failure in the socket layer of the communications. For example, the selected communication protocol might be unsupported on the given machine. Alternatively, an unsupported version of the networking software might be being used (e.g. Windows Sockets 1.0).



Network Failure

A network error occurred. Some CodeBase communications protocols are dependent on network stability. For example, if the local file server is shut-down, CodeBase might not be able to continue operations, and will fail with an e4net error. Alternatively, a physical network error might be detected (e.g. a network cable is physically cut or unplugged, thus removing the physical connection of the computer from the network).



Failure Loading Communication DLL

An attempt to load the specified communication DLL has failed. Ensure that the requested DLL is accessible to the application.



Network Timed Out

This error occurs whenever CodeBase has timed out after Code4::timeout seconds have elapsed.



Communication Message Corrupt

A communication message error has been detected. For example, a client might not have been able to properly send a complete message to the server.



Communication Packet Length Mismatch

A packet length error has been detected. Possibly the CodeBase client software mismatches the server implementation.



Communication Packet Corrupt

A packet corruption has been detected. Check e4corrupt for potential causes of this failure.



System-level Communications Error

This error would occur if the network hardware failed or if the server disconnected from the client.

Miscellaneous Errors

Constant Name





CodeBase Capabilities Exceeded (system maxed out)

The physical capabilities of CodeBase have been maxed out. These errors can often be solved by modifying system or network configuration files which have placed arbitrary limits on the system. This error will also be generated when the maximum number of users for the server is exceeded.



CodeBase in an Unacknowledged Error State

CodeBase failed due to being in an error state already. Generally comes out as an error return code if a high-level function is called after having disregarded a CodeBase error condition.



Name not Found error

The specified name was invalid or not found. For example, Data4::index was called with a non-existent index alias.



Authorization Error (access denied)

The requested operation could not be performed because whoever issued the request has insufficient authority to perform the operation. For example, a user without creation privileges has made a call to Data4::create.

Server Failure Errors

Constant Name





Server Failure

A client-server failure has occurred. In this case, the client connection was probably also lost.



Server Configuration Failure

An error has been detected in the server configuration file. The configuration file is only accessed when the server is first started, so once the server is operational, this error cannot occur.