tdbf, dokumenty
[ Pobierz całość w formacie PDF ]
TDbfmanual
MichaNelissen
9thMay2003
Contents
1Introduction 4
2Methods
4
2.1GetFieldData.................................... 4
2.2Resync........................................ 5
2.3CreateBlobStream................................. 5
2.4Translate...................................... 5
2.5ClearCalcFields................................... 6
2.6CompareBookmarks................................ 6
2.7CheckDbfFieldDefs................................. 6
2.8AddIndex...................................... 6
2.9RegenerateIndexes................................. 7
2.10CancelRange.................................... 7
2.11SearchKey...................................... 7
2.12SetRange...................................... 8
2.13UpdateIndexDefs.................................. 8
2.14GetIndexNames................................... 8
1
2.15TryExclusive.................................... 8
2.16EndExclusive.................................... 8
2.17LockTable...................................... 9
2.18UnlockTable..................................... 9
2.19OpenIndexFile................................... 9
2.20DeleteIndex..................................... 9
2.21CloseIndexFile................................... 9
2.22RepageIndexFile.................................. 10
2.23Locate........................................ 10
2.24LocateRecord.................................... 10
2.25IsDeleted...................................... 10
2.26Undelete....................................... 11
2.27CreateTable..................................... 11
2.28CreateTableEx................................... 11
2.29CopyFrom...................................... 11
2.30RestructureTable.................................. 12
2.31PackTable...................................... 12
2.32EmptyTable..................................... 12
2.33Zap......................................... 12
2.34InitFieldDefsFromFields.............................. 12
3Properties
13
3.1AbsolutePath.................................... 13
3.2DbfFieldDefs.................................... 13
3.3PhysicalRecNo................................... 13
3.4LanguageID..................................... 13
2
3.5LanguageStr..................................... 13
3.6CodePage...................................... 14
3.7ExactRecordCount................................. 14
3.8DbfFile....................................... 14
3.9DisableResyncOnPost............................... 14
3.10DateTimeHandling................................. 14
3.11Exclusive...................................... 14
3.12FilePath....................................... 15
3.13FilePathFull..................................... 15
3.14Indexes....................................... 15
3.15IndexFieldNames.................................. 16
3.16IndexName..................................... 16
3.17MasterFields.................................... 16
3.18MasterSource.................................... 16
3.19OpenMode..................................... 17
3.20ReadOnly...................................... 17
3.21ShowDeleted.................................... 17
3.22Storage....................................... 17
3.23StoreDefs...................................... 18
3.24TableName..................................... 18
3.25TableLevel...................................... 18
3.26UseFloatFields................................... 19
3.27Version....................................... 19
3.28BeforeAutoCreate................................. 19
3.29OnCompareRecord................................. 19
3
3.30OnLanguageWarning................................ 19
3.31OnLocaleError................................... 19
3.32OnIndexMissing.................................. 20
3.33OnCopyDateTimeAsString............................ 20
3.34OnTranslate..................................... 20
1Introduction
TDBFisafreewarenativedataaccesscomponentforallBorlandDelphilanguagecompatible
environments.ThisincludesDelphi,C++BuilderandKylix.Itallowsyoutocreatevery
compactdatabaseprogramswhichdon’tneedanyspecialinstallerprograms.TheDBengine
codeiscompiledrightintoyourexecutable.Ithasthefollowingfeatures:
²
WorkswithouttheBorlandDatabaseEngine.
²
AllowstheuseofalldBASEnativetype(character,numeric,logical,date,andmemo).
SeepropertyTableLevel.
²
Memofilesaresupported,bothtextandbinarysoyoucanusefieldswithnosizelimit.
²
Fileformat100%compatiblewithdBASEIII+ordBASEIVordBASEforWindows.
²
SupportforClipperandVisualFoxProtables.
²
Restructuringexistingtablestodrop,addormodifyacurrenttablestructurewhile
retainingtabledata.
²
Multi-useraccessthroughBDEcompatiblelocking.Only1usercanlockaparticular
recordforwriting,butmultipleuserscanreadtherecord.
²
Indexsupportavailableforfastsorting,searchingandrangingofbigtables.Indexes
supportedincludeNDXandMDXindexfiles.
²
Expressionparserforbothindexesandfilters.
²
OSdependantmulti-codepageandmulti-localesupport.Thisallowsyoutoreadand
writetablesindi®erentcodepagesthanyourOSandtospecifyasortorderbettersuited
foryourlanguageorlocale.Currently,thisisnotyetsupportedontheLinuxOS.
2Methods
2.1GetFieldData
4
functionGetFieldData(Field:TField;Buffer:Pointer):Boolean;
override;
f
FromBorlandHelp
g
MostapplicationsdonotneedtocallGetFieldData.TFieldobjects
callthismethodtoimplementtheirGetDatamethod.
TheFieldorFieldNoparameterindicatesthefieldwhosedatashouldbefetched.Fieldspeci-
fiesthecomponentitself,whileFieldNoindicatesitsfieldnumber.TheBu®erparameterisa
memorybu®erwithsu±cientspacetoacceptthevalueofthefieldasitexistsinthedatabase
(unformattedanduntranslated).NativeFormatindicateswhetherthedatasetfetchesthefield
inC++Buildersnativeformatforthefieldtype.WhenNativeFormatisfalse,thedataset
mustconvertthefieldvaluetothenativetype.Thisallowsthefieldtohandledatafrom
di®erenttypesofdatasets(ADO-based,BDE-based,andsoon)inauniformmanner.
GetFieldDatareturnsavaluethatindicateswhetherthedatawassuccessfullyfetched.
GetFieldDatareturnstrueifthebu®erissuccessfullyfilledwiththefieldsdata,andfalseif
thedatacouldnotbefetched.
2.2Resync
procedureResync(Mode:TResyncMode);override;
TDbfsupportsdisablingofresynccalls.SeepropertyDisableResyncOnPost.
2.3CreateBlobStream
functionCreateBlobStream(Field:TField;Mode:TBlobStreamMode):
TStream;override;{virtual}
f
FromBorlandHelp
g
CallCreateBlobStreamtoobtainastreamforreadingdatafromor
writingdatatoabinarylargeobject(BLOB)field.TheFieldparametermustspecifya
TBlobFieldcomponentfromtheFieldspropertyarray.TheModeparameterspecifieswhether
thestreamwillbeusedforreading,writing,orupdatingthecontentsofthefield.
Blobstreamsarecreatedinaspecificmodeforaspecificfieldonaspecificrecord.Applications
shouldcreateanewblobstreameverytimetherecordinthedatasetchangesratherthan
reusinganexistingblobstream.
2.4Translate
{$ifdefDELPHI_4}
functionTranslate(Src,Dest:PChar;ToOem:Boolean):Integer;
override;{virtual}
{$else}
procedureTranslate(Src,Dest:PChar;ToOem:Boolean);override;{
virtual}
{$endif}
5
[ Pobierz całość w formacie PDF ]