none
Create an Access mdb file using OLEDB

    Question

  • I'm trying to work out how to create a new empty Access database using OLEDB.  Once I have the database I know how to create a connection to it and create tables and the like inside it, I am just struggling to create that mdb file in the first place.  It seems that this is possible with ADO or DAO but I can't find out or work out how to do it in OLEDB.

    Can anyone help?

    Lastly, does anyone know of a simple explanation of when to use DAO, ADO and OLEDB for bears of little brain like myself?

     

    Tuesday, October 18, 2011 10:40 AM

Answers

  • hello,

    MDAC SDK is the file you need to download and install.

    It will help you to understand DAO, ADO and OLEDB (and also ODBC) data access strategies. It provides help and samples.

    To create a MDB file, you'll have to choose a version of access and most of the time you need to create a blank database from Access and ship it with your software.

    There are several CreateDatabase methods provided by ADO but it requires the ADO dll provided by Access. So prefer to create and blank and empty db using Access and ship it as free with your app.


    Christophe Pichaud
    • Marked as answer by Rob Pan Monday, October 24, 2011 8:09 AM
    Tuesday, October 18, 2011 12:46 PM
  •  does anyone know of a simple explanation of when to use DAO, ADO and OLEDB for bears of little brain like myself?

     

    DAO and ADO are both serve to access data sources - they provide a middleware layer between programming languages and OLE DB. In Windows world DAO was replaced by ADO, and long ago (according to Wikipedia "Microsoft says that DAO will not be available in its future 64-bit operating systems").  I.e. you implement ADO+OLE DB on any Windows from Windows 2000 (with or without .NET) to access databases that have OLE DB provider. But according to this http://social.msdn.microsoft.com/Forums/en/sqldataaccess/thread/e696d0ac-f8e2-4b19-8a08-7a357d3d780f and corresponding Wikipedia article, OLE DB support can be (will be?) deprecated and "...by fully aligning with ODBC, Microsoft will be focusing on one set of industry standard APIs that are widely used by many of our customers."

    With .NET comes ADO.NET which is to be used with C#/VB.NET and C++/CLI.

    • Marked as answer by Rob Pan Monday, October 24, 2011 8:09 AM
    Tuesday, October 18, 2011 2:10 PM

All replies

  • hello,

    MDAC SDK is the file you need to download and install.

    It will help you to understand DAO, ADO and OLEDB (and also ODBC) data access strategies. It provides help and samples.

    To create a MDB file, you'll have to choose a version of access and most of the time you need to create a blank database from Access and ship it with your software.

    There are several CreateDatabase methods provided by ADO but it requires the ADO dll provided by Access. So prefer to create and blank and empty db using Access and ship it as free with your app.


    Christophe Pichaud
    • Marked as answer by Rob Pan Monday, October 24, 2011 8:09 AM
    Tuesday, October 18, 2011 12:46 PM
  •  does anyone know of a simple explanation of when to use DAO, ADO and OLEDB for bears of little brain like myself?

     

    DAO and ADO are both serve to access data sources - they provide a middleware layer between programming languages and OLE DB. In Windows world DAO was replaced by ADO, and long ago (according to Wikipedia "Microsoft says that DAO will not be available in its future 64-bit operating systems").  I.e. you implement ADO+OLE DB on any Windows from Windows 2000 (with or without .NET) to access databases that have OLE DB provider. But according to this http://social.msdn.microsoft.com/Forums/en/sqldataaccess/thread/e696d0ac-f8e2-4b19-8a08-7a357d3d780f and corresponding Wikipedia article, OLE DB support can be (will be?) deprecated and "...by fully aligning with ODBC, Microsoft will be focusing on one set of industry standard APIs that are widely used by many of our customers."

    With .NET comes ADO.NET which is to be used with C#/VB.NET and C++/CLI.

    • Marked as answer by Rob Pan Monday, October 24, 2011 8:09 AM
    Tuesday, October 18, 2011 2:10 PM