The information in this article applies to:
SYMPTOMSIn Microsoft Excel, if you attempt to use data access objects (DAO) without first referencing the Microsoft DAO 3.0 or 3.5 Object Library, you may receive an error message. This can cause difficulties when you are developing applications for distribution. WORKAROUND
Instead of referencing the Microsoft DAO 3.0 or 3.5 Object Library, you
can use object linking and embedding (OLE) to create a database engine
object. You can then use the database engine object in references to the
database. In this way, you do not have to create a reference to the
Microsoft DAO 3.0 or 3.5 Object Library file.
would generate the "User-defined type not defined" error. However, the
following statement does not:
Visual Basic Code ExampleMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:http://www.microsoft.com/support/supportnet/overview/overview.aspThe following code example shows how to declare and use the database engine. The example assumes you have the Northwind.mdb sample database installed in c:\MSOffice\Access\Samples.
REFERENCES
For more information about creating a DAO reference in Microsoft Excel 97,
from the Visual Basic Editor, click the Office Assistant, type Dao
reference click Search, and then click to view "What you need to create
Visual Basic macros that retrieve external data."
Q176476 OFF: Office Assistant Not Answering Visual Basic Questions"Developing Microsoft Excel 95 Solutions with Visual Basic for Applications," Chapter 7, "Database Access and Messaging", page 489. DAO Reference library, "DBEngine Object" For more information about DAO, establish a reference to the "Microsoft DAO 3.0 Object Library". Then on the View menu, click Object Browser. Under Libraries/Workbooks, select DAO, and under Objects/Modules, click DBEngine. Additional query words: 97 XL97 XL7
Keywords : kbprg kbdta KbVBA |
Last Reviewed: November 11, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |