Click here to Skip to main content
Click here to Skip to main content

The alxBase classes for work with DBF files

, 5 Nov 2002
Rate this:
Please Sign up or sign in to vote.
The alxBase classes for work with dbf files.


This classes is useful for work with dbf files. The current version supports formats: FoxPro, Visual FoxPro, dBASEIII - dBASE 5.x, Clipper and HiPer-SIx. The memo fields also are supported. CDBFRecordset provides all the useful functions for navigation and modification in table. CDBFCursorset it is possible to use for work only with the selected records. CDBFTableDef it is used for creation and updating of structure of the table.

Create/Update table structure

For creation/updating of structure of the table are available functions:

  • ModifyTable
  • AddField
  • InsertField
  • ModifyField
  • MoveField
  • DeleteField
  • UpdateTable

For cancels any pending updates you may call function CanselUpdateTable().

	CDBFTableDef mNewTable;
	// begin create

	// add field
	FIELD_REC FieldRec;
	memset(&FieldRec, 0, sizeof(FIELD_REC));
	memcpy(FieldRec.field_name, szFieldName, 10);
	FieldRec.field_type = FLD_TYPE_CHARACTER;
	FieldRec.len_info.char_len = 20;

	// ...

	// end create
catch(CDBFException* e)


For navigation are supported functions:

  • MoveNext
  • MovePrev
  • MoveFirst
  • MoveLast
  • SetAbsolutePosition

You also may use functions: IsEOF(), IsBOF(), GetRecordCount(), GetAbsolutePosition().

	CDBFRecordset m_Set;
		// ...
catch(CDBFException* e)

Append/Edit record

For addition, changes of record are functions:

  • Edit
  • SetFieldValue
  • Delete
  • Undelete
  • Update

You also may use functions: LockRecord(), UnlockRecord(), GetFieldvalue().

catch(CDBFException* e)

Find Functions

For find are supported functions:

  • FindNext
  • FindLast
  • FindPrev
	BOOL bFind = m_Set.FindFirst("LIKE('*Club*', NAME)");
		// ...
		bFind = m_Set.FindNext();
catch(CDBFException* e)

Parameter of functions: FindFirst(), FindLast(), ... string expression of dBASE language.


For the filter SetFilter function is used:

	m_Set.SetFilter("LIKE('*Club*', NAME)");
	// ...
catch(CDBFException* e)

This function is supported only in classes CDBFCursorset and CDBFMemCursorset.

DBFView Demo

This sample shows some opportunities of library alxBASE.

More information about the product can be found at


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Russian Federation Russian Federation
Year of birth - 1974.
Eeducation - was ended by Kaliningrad State University in 1997.
Now I work as the engineer-programmer in Kaliningrad (RUSSIA).

Comments and Discussions

QuestionAssertion Failed! PinmemberGoa3-Jul-07 8:36 
AnswerRe: Assertion Failed! PinmemberGoa4-Jul-07 6:18 
QuestionalxBase without mfc Pinmemberjoviens19-Dec-06 6:44 
AnswerRe: alxBase without mfc PinmemberS Mario26-Oct-09 19:08 
Generalfield content PinmemberJoao Araujo21-Jan-06 16:51 
GeneralDelete records Pinmemberpgiustinoni7-Jul-05 7:49 
GeneralGood work But... Pinmemberali TEKE11-Apr-05 4:37 
GeneralProblem in adding new records PinmemberMr.V.Stephen30-Jan-05 0:04 
GeneralRe: Problem in adding new records PinmemberEndlessWinter10-Feb-05 17:18 
GeneralIts really a very nice project Pinmembervstephen200222-Jan-05 0:37 
GeneralUsing the FindFirst function PinmemberAlex Evans1-Nov-04 12:14 
GeneralRe: Using the FindFirst function PinmemberEndlessWinter10-Feb-05 17:23 
GeneralConverted library for Windos CE PinmemberAlex Evans2-Oct-04 22:53 
GeneralUsing this with Windows CE PinmemberAlex Evans1-Oct-04 21:51 
GenerallockRecord() Pinmemberthangoftin29-Aug-04 19:18 
GeneralUsing the FindFirst function PinmemberAlex Evans1-Nov-04 12:17 
QuestionHow can i insert/update/delete image file? PinmemberMr.Ahn7-Jul-04 2:21 
QuestionHow to pack deleted record Pinmembersimranjeet11-Jun-04 4:08 
AnswerRe: How to pack deleted record PinmemberAlexey14-Jun-04 20:28 
QuestionHow to pack deleted record Pinsusssimranjit11-Jun-04 4:02 
QuestionSample db files? Pinmemberchenhuisheng13-Apr-04 16:21 
GeneralGreat!! - one question Pinmemberbdiamond29-Mar-04 4:30 
GeneralRe: Great!! - one question PinmemberAlexey29-Mar-04 19:33 
Generalcan't write header info correctly Pinmemberbdiamond18-Mar-04 8:10 
this is my fault. I don't understand how to modify the header info correctly to specify the table type correctly (along with the other fields). I create a table, and using the sample viewer demo that came with this project, I can see the data in the table, even though a couple of the column header names are messed up. But when I try to open up the table in VFP I get a message telling me to specify the code page it was created in. I tried to modify the header info, but I can't seem to get this to work right. Can you please help?
If it's broken, I probably did it
GeneralRe: can't write header info correctly PinmemberAlexey18-Mar-04 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141216.1 | Last Updated 6 Nov 2002
Article Copyright 2002 by Alexey
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid