CDBFAPI - powerful DBF access tool

Buy Now! Free Download
AllWindowsiOS,OSXOther

Products
CDBF - DBF Viewer and Editor
DBF Viewer/Editor for iOS
DBF reanimator
CDBFlite
¤ CDBFAPI
Excel Library
DBF Script
CSV to DBF Converter
CSV to DBF Converter for Mac
CSV to XLS Converter
CSV to XLS Converter for Mac
CSV to SQLite Converter for Mac
XLS to DBF Converter
XLS to DBF Converter for Mac
XLS to CSV Converter
XLS to CSV Converter for Mac
DBF to CSV Converter
DBF to CSV Converter for Mac
DBF to XLS Converter
DBF to XLS Converter for Mac
DBF to MDB Converter
DBF to SQL Converter
DBF to SQL Converter for Mac
DBF to SQLite Converter for Mac
DBF to XML Converter
DBF to XML Converter for Mac
DBF to DBF Converter
DBF to DBF Converter for Mac
DBF to HTML Converter
MDB to DBF Converter
MDB to XLS Converter
MDB to CSV Converter
DBF to PDB Converter
PDB to DBF Converter

CDBFAPI C++, .NET functions

Constructors:

        cdbfapiPlus();
        cdbfapiNet();

//////////////////////////////////////
        
void   initLibrary(int magicNumber, char* email);
void   initLibrary(int magicNumber, String^ email);

        allows you to use the library in a read/write mode.

//////////////////////////////////////

BOOL   openDBFfile(char* filename);
BOOL   openDBFfile(String^ filename);

        opens a file. returns non-zero value if successful and 0 if fail

void   closeDBFfile();

        closes the file and releases a used memory

//////////////////////////////////////

int    recCount();

        returns number of records in the file

int    fieldCount();

        returns number of fields in the file

//////////////////////////////////////

BOOL   readRecord(int recno);

        reads a record to internal memory block. 
        after reading you can use functions getString(), getValue()

BOOL   writeRecord(int recno);

        writes a record from internal memory block to the file.
        you have to fill the memory with necessary values using setValue()

//////////////////////////////////////

int   indexOfField(char* fieldname);
int   indexOfField(String^ fieldname);

        returns index of the field with the name in range 0 - fieldCount()-1
        returns -1 if the field does not exist.

//////////////////////////////////////

char*    getString(int fieldno);
String^  getString(int fieldno);

        returns content of any field as a string value

double getValue(int fieldno);

        returns content of numeric fields as a double value

//////////////////////////////////////

BOOL   isMemoField(int fieldno);

        returns TRUE for memo fields

BOOL   isNumericField(int fieldno);

        returns TRUE for numeric fields (N,F,Y,B)

//////////////////////////////////////

BOOL   isDeleted();

        returns TRUE if the record in the internal memory is marked as deleted

BOOL   isDeleted(int fieldno);

        returns TRUE if the specified record in the file is marked as deleted

//////////////////////////////////////

void   clearRecord();

        removes all information in the internal memory block and 
		fill fields with default values (0x00 or 0x20). 
		you have to call this when you want to add a new record

void   clearField(int fieldno);

        removes information in the specified field in the internal memory.

void   setField(int fieldno, char* string);
void   setField(int fieldno, String^ string);

        put the string value to the field

void   setField(int fieldno, double value);

        put the numeric value to the field

void   setField(int fieldno, char* string, double value);
void   setField(int fieldno, String^ string, double value);

        put either the string value or the numeric value to the field, 
		depending on field type

//////////////////////////////////////

BOOL   markAsDeleted(int fieldno);

        marks the record as deleted (marked with *)

BOOL   recallDeleted(int fieldno);

        removes the mark for the specified record.

//////////////////////////////////////

BOOL   deleteRecord(int recno);

        physically removes the record

BOOL   appendRecord(BOOL blankrecord);

        appends a new record to the file. 
		if blankrecord == TRUE, then record will be empty.
        if blankrecord == FALSE, then the information 
		from the internal memory block is used

BOOL   insertRecord(int recno, BOOL blankrecord);

        insert a new record to the file in position 'recno'

//////////////////////////////////////

void   setOrder(char* fieldlist);
void   setOrder(String^ fieldlist);

        sets order of records by some field or list of fields: FIELD1,FIELD2 

void   setOrderA(char* fields[]);

        sets order of records by some array of fields: { FIELD1,FIELD2,NULL }

void   unsetOrder();

        sets the default order.

void   setFilter(char* expression);
void   setFilter(String^ expression);

        set a filter for records by some criterion.
        you can use <, >, =, ==, <=, >=, ~ operators in the expression
        FIELD1=value
        FIELD2~substring        field contains a substring
        you can use & and | to unite expressions 
        FIELD1=123.45&FIELD2=John
        
void   unsetFilter();

        removes filter and order.

//////////////////////////////////////

BOOL   pack();

        removes records marked as deleted from the file

BOOL   zap();

        removes all records from the file

//////////////////////////////////////

int    fileType();

        returns a type of the file

int    recordLength();

        returns length of records

//////////////////////////////////////

char*     fieldName(int fieldno);
String^   fieldName(int fieldno);

        returns a name of the field

char   fieldType(int fieldno);

        returns a type of the field

int   fieldLength(int fieldno);

        returns length of the field

int   fieldDecimal(int fieldno);

        returns size of the fractional part for the numeric field

//////////////////////////////////////

BOOL   prepareNewTable();

        you have to call this when you want to create a new dbf file

void   addField(char* fieldname, char fieldType, int length);
void   addField(String^ fieldname, char fieldType, int length);

        adds a field to the new file

void   addField(char* fieldname, char fieldType, int length, int decimal);
void   addField(String^ fieldname, char fieldType, int length, int decimal);

        adds a field to the new file

BOOL   createTable(char* filename, int fileType);
BOOL   createTable(String^ filename, int fileType);

        creates a new file using previously added fields.
        returns non-zero if successful

BOOL   createAndOpenTable(char* filename, int fileType);
BOOL   createAndOpenTable(String^ filename, int fileType);

        creates a new file using previously added fields and opens it.
        returns non-zero if successful

//////////////////////////////////////

void   encoding(int encoding);

        sets the current encoding. 
        for DOS/Windows only 0 or 1 are valid.
        for iOS, OSX you can use any single-byte encoding

void   dateFormat(char* format);
void   dateFormat(String^ format);

        you can specify: dmy, mdy, ymd, asis

void   dateDelimiter(char delimiter);

        you can specify a symbol: - . /

Related Links
Functions

Copyright © WhiteTown Software, 1996-2017 | Privacy policy | Site map