![1516546 Abstract computer blue background | Embarcadero RAD Studio Delphi C++Builder Blogs](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2020/08/1516546-Abstract-computer-blue-background.jpg?resize=1140%2C694&ssl=1)
If you need to work with Microsoft Access databases in your application then you can use the Data Access Objects (DAO) library from WINSOFT:
Component list
The DAO library contains the following components: TDAODatabase, TDAODataSet, TDAOTable, TDAOQuery, TDAOUpdateSQL
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
// Create a new database uses DAO, DAODS; GetDBEngine.CreateDatabase('C:\database.mdb', dbLangGeneral, EmptyParam); // Repair corrupted database uses DAO, DAODS; GetDBEngine.RepairDatabase('C:\database.mdb'); // Compact database uses DAO, DAODS; GetDBEngine.CompactDatabase('C:\database.mdb', 'C:\newdb.mdb', EmptyParam, EmptyParam, EmptyParam); // Insert records very fast using DAO recordset uses DAO, DAODS; with DAODataSet.Recordset do try Parent.BeginTrans; for i := 1 to 1000 do begin AddNew; Fields[0].Value := i; Update(dbUpdateRegular, False); end; Parent.CommitTrans(dbForceOSFlush); except Parent.Rollback; raise; end; |
TDAODatabase
TDAODatabase provides control over a connection to database in a database application. Use TDAODatabase when a database application requires any of the following control over a database connection: persistent database connections customized database logins transaction control application-specific database workgroup file (SystemDB)
TDAODataSet / Example
TDAODataSet is a TDataSet descendent that encapsulates an DAO table or query. TDAODataSet provides native access to MS Access tables and queries. It also enables access to dBase, FoxPro, ODBC and other DAO data sources. A TDAODataSet component can also work with a subset of records within a database table using filters and SQL statements.
TDAOTable
TDAOTable is a dataset component used to retrieve data from database tables.
TDAOQuery
TDAOQuery encapsulates a dataset with a result set that is based on an SQL statement. Use TDAOQuery to access a database using SQL statements. DAOQuery components can be used with MS Access and others databases like dBase, FoxPro, ODBC.
DAOQuery components are useful because they can access more than one table at a time (called a ”join” in SQL), automatically access a subset of rows and columns in its underlying table(s), rather than always returning all rows and columns
TDAOUpdateSQL
Provides an object for updating read-only datasets.
Use a TDAOUpdateSQL object to provide SQL statements used to update read-only datasets represented by TDAODataSet components. A dataset is read-only either by design or circumstance. If a dataset is read-only by design, the application itself does not provide a user interface for updating data, but may institute a programmatic scheme behind the scenes. If a dataset is read-only by circumstance, it indicates that the DAO returned a read-only result set. This usually happens for queries made against multiple tables.
TAAOUpdateSQL provides a mechanism for circumventing what some developers consider an SQL-92 limitation. It enables a developer to provide INSERT, UPDATE, and DELETE statements for performing separate update queries on otherwise read-only result sets in such a manner that the separate update queries are transparent to the end user.
In practical application, a TDAOUpdateSQL object is placed on a data module or form, and linked to a TDAODataSet component through that component’s UpdateSQL property. If the UpdateSQL property points to a valid TDAOUpdateSQL object, the SQL statements belonging to the update object are automatically applied when updates are applied.
This component was developed by WINSOFT.
Works with: Delphi, C ++ Builder, RAD Server,
Works on: Windows 32-bit, Windows 64-bit
Source code included in registered version. Royalty free distribution with application without any limitation.
Related links
DAO Database Collection FAQ
DAO Detect
Head over and check out the full WINSOFT DAO library in Delphi and C++Builder.
Like what you see? You can get the DAO Library for Android and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4.1 today!
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition