Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version

The alxBase classes for work with DBF files

, 5 Nov 2002
The alxBase classes for work with dbf files.
alxbasea2.zip
alxBASE
alxBASE.dsp
alxBASE.dsw
alxBaseDLL.dsp
DLL
INCLUDE
res
nodrop.cur
Lib
Samples
DBFView
DBFViewApp.clw
DBFViewApp.dep
DBFViewApp.dsp
DBFViewApp.dsw
Release
DBFView.exe
res
bitmap1.bmp
DBFViewApp.ico
DBFViewDoc.ico
Toolbar.bmp
SRC
alxbasea3.zip
alxBASE.dep
alxBASE.dsp
alxBASE.dsw
alxBASE.mak
alxBASE.suo
alxBaseDLL.dsp
l.rus
nodrop.cur
DBFViewApp.clw
DBFViewApp.dep
DBFViewApp.dsp
DBFViewApp.dsw
RCa00472
DBFView.exe
bitmap1.bmp
DBFViewApp.ico
DBFViewDoc.ico
Toolbar.bmp
// DBFCursorset.h : interface of the CDBFCursorset class
//
/////////////////////////////////////////////////////////////////////////////
/*
�����:              �������� �.�.
����������:         alxsoft@gazinter.net
*/
/////////////////////////////////////////////////////////////////////////////

#if !defined(ALX_DBFCURSORSET_H__INCLUDED_)
#define ALX_DBFCURSORSET_H__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>
#include "DBFRecordset.h"

////////////////////////////////////////////////////////////////////////
// CDBFCursorset - the result of a query or base table browse

class ALX_EXT_CLASS CDBFCursorset : public CDBFRecordset
{
	DECLARE_DYNAMIC(CDBFCursorset)

// Constructor
public:
	CDBFCursorset(CDBFTableDef* pDBFTable = NULL);

	void Open(LPCTSTR lpszFileName, UINT nOpenFlag = ALX_DBF_USE_SHARED);
	void Close();

// Attributes
public:
	BOOL IsOpen() const;	// ������ �� �����
	BOOL IsBOF() const;		// ������ �� ������
	BOOL IsEOF() const;		// ��������� �� ������

	long GetRecordCount();	// ���������� �������

protected:
	long m_nCurCursorRecN;	// ������ ������� ������

	BOOL m_bBOF;			
	BOOL m_bEOF;

// Operations
public:
	// Cursor operations
	void MoveNext();		// ������� �� ��������� ������
	void MovePrev();		// ������� �� ���������� ������
	void MoveFirst();		// ������� �� ������ ������
	void MoveLast();		// ������� �� ��������� ������
	void Move(long lOffsetRec); // ������� �� ������ �� ��������


	long GetAbsolutePosition();					// ���������� ������� ���. ������
	void SetAbsolutePosition(long lPosition);	// ������� �� ���������� ������� � ������

	// edit buffer operations
	virtual void AddNew();		// �������� ������
	virtual void Edit();		// �������� ������

	virtual void Update();		// ��������� ���������
	virtual void CancelUpdate();// �����

	virtual void Remove();		// ������� ������ �� ������

	// Recordset operations
	void Requery();				// �������� ����� �������

	// ���������� ���������� ��� ��� ���������� �� �������� ������
	void SetDelete(BOOL bHideDeleteRec = TRUE);
	BOOL GetDelete();
	// �������� ��������� �� ������� �������
	void SetFilter(BOOL (FAR * lpfnIsInclude) (DBF_CHAR*, CDBFFields* pDBFFields));
	// ����������
	void SortByField(int nIndex, BOOL bDesc = FALSE);
	void SortByField(LPCTSTR lpszName, BOOL bDesc = FALSE);

// Overridables
public:


// Implementation
public:
	virtual ~CDBFCursorset();

	// Out-of-date functions kept for backward compatability

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif


protected:
	virtual void ThrowDBFException(long nError = NO_ALX_DBF_ERROR);

private:
	void SetRecord(long lRecNumber, const DBF_CHAR* lpBuffer);	// �������� ������

	void qsort (int from, int to);						// �������� ���������� �������
	int compare(const long elem1, const long elem2 );	// �������� ��������� �������

	CArray<long, long> m_RecPtr;// ������ ���������� �� ������ �������

	int m_nSortedField;			// ������ ���� �� �������� ������������� �������
	BOOL m_bDesc;				// ���� ����� ����������� �� �������� TRUE

	BOOL m_bShowDeletedRec;		// ���������� �������� �� ���������� �� �������� ������

	// ��������� �� ������� �������
	BOOL (FAR * m_lpfnIsInclude) (DBF_CHAR*, CDBFFields* pDBFFields);
};

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

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(ALX_DBFCURSORSET_H__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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

Share

About the Author

Alexey
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).

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