Resource Page DescriptionThese code examples provide detailed information about data access technologies to use when using native C and C++ to develop solutions against the ACE engine. By using data access APIs such as DAO, OLE DB, ADO or ODBC, you can continue to create custom Access solutions for the most complex scenarios. As the default provider for the ACE engine, the Direct DAO driver provides the most comprehensive native interface to Access databases in general. It not only integrates well with the ACE engine, but it is also fast, stable and backward-compatible with the older file formats. As such, DAO is the recommended data access API when developing your Access solutions.
For more information, see the MSDN article titled
Developing Access Solutions with Native C or C++:
http://msdn.microsoft.com/en-us/library/cc811599.aspx Code ExamplesThis download presents five complete programs created with Microsoft Visual C++ 2008 that are available for download. Source code is compatible with older versions of Visual C++ as well, but you might need to create additional project files for the Visual C++ version with which you want to compile this code.
All programs perform semantically-identical steps by demonstrating syntactical differences in the data access technologies used. Moreover, the console output of each program is almost identical. Examples present the basics of data access, including how to make a connection to a database, and how to work with a recordset on a SQL query.
Here is the list of steps that are performed in each code example:
- Define the connection string.
- Connect to the C:\Northwind 2007.accdb database.
- Verify the connection and display data source name.
- Build the SQL query.
- Execute the query and create a record set.
- Retrieve and display a schema of the record set.
- Fetch and display the actual data.
- Display the total number of retrieved rows.
- Close all handles.
- Handle the errors and exceptions where appropriate.
I used similar code to measure an overall speed against these libraries. The performance results are published in the MSDN article as well.