Sign in Join
FPDoc Onlineexperiment

TDatabase class

In unit DB

Base class for connecting a FreePascal application to an external Database engine.

Declaration

pascal
TDatabase = class(TCustomConnection)

Inheritance

  1. TDatabase
  2. TCustomConnection
  3. TComponent
  4. TPersistent
  5. TObject

Descends from it: TSQLConnection

Description

TDatabase is a component whose purpose is to provide a connection to an external database engine, not to provide the database itself. This class provides generic methods for attachment to databases and querying their contents; the details of the actual connection are handled by database-specific components (such as SQLDb for SQL-based databases, or DBA for DBASE/FoxPro style databases).

Like TDataset, TDatabase is an abstract class. It provides methods to keep track of datasets connected to the database, and to close these datasets when the connection to the database is closed. To this end, it introduces a Connected boolean property, which indicates whether a connection to the database is established or not. The actual logic to establish a connection to a database must be implemented by descendent classes.

See also

Properties

TransactionCountpublicNumber of transaction components connected to this database.
TransactionspublicIndexed access to all transaction components connected to this database.
DirectorypublicDirectory for the database.
IsSQLBasedpublicIs the database SQL based.
ConnectedpublishedIs the database connected.
DatabaseNamepublishedDatabase name or path.
KeepConnectionpublishedShould the connection be kept active.
ParamspublishedConnection parameters.

Methods

CheckConnectedprotected
CheckDisConnectedprotected
DoConnectprotected
DoDisconnectprotected
GetConnectedprotected
GetDatasetprotected
GetDataSetCountprotected
DoInternalConnectprotected
DoInternalDisConnectprotected
CreatepublicInitialize a new TDatabase class instance.
DestroypublicRemove a TDatabase instance from memory.
CloseDataSetspublicClose all connected datasets.
CloseTransactionspublicEnd all transactions.
StartTransactionpublicStart a new transaction.
EndTransactionpublicEnd an active transaction.

Inherited

From TCustomConnection (22)

AfterConnect AfterDisconnect BeforeConnect BeforeDisconnect Close CloseForDestroy DataSetCount DataSets DoCloseError DoLoginPrompt ForcedClose GetLoginParams InternalHandleException Loaded LoginPrompt OnCloseError OnLogin Open SetConnected SetForcedClose SetLoginParams StreamedConnected

From TComponent (73)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.