• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. From DAO to ADO > DAO in Access Projects

DAO in Access Projects

There is a trick that lets you use existing DAO code in Access projects as well. The trick involves using a DAO Database object that establishes an open database connectivity (ODBC) connection to the SQL Server/MSDE database to which the project is connected. It is our experience that a majority of existing DAO programs can be executed using this trick. We have been using it for a number of projects during a transition period to quickly access working applications while converting database applications to Access projects.

The DAODatabase function shown in the following listing returns a DAO.Database object. The Database object does not refer to an Access mdb database. Instead, it uses an ODBC connection string derived from the CurrentProject.Connection property’s connection string data to refer to the SQL Server/MSDE database to which the current project is connected.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint