The information in this article applies to:
SUMMARYIn Microsoft Excel versions 97 and 7.0, you can use data access objects (DAO) in Visual Basic for Applications to retrieve the results of QueryDef from Microsoft Access. This article demonstrates how to do so. MORE INFORMATIONMicrosoft 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.aspThis article uses the Northwind database included with Microsoft Office 95 Professional. If you selected the default options, the database is located in the \Msoffice\Access\Samples folder. If your Northwind database is located in a different folder, edit the provided code before running it. In Microsoft Office 97, the default path for the Northwind database is \Program Files\Microsoft Office\Office\Samples\Northwind.mdb. A QueryDef is created in Microsoft Access and saved with the database file. It consists of a query and may or may not include criteria. NOTE: If you receive the "User-defined type not defined" error, activate a module sheet, click References on the Tools menu, and click Microsoft DAO 3.0 Object Library check box. Retrieving the results of a QueryDef from Microsoft Access is a five step process as follows:
REFERENCES
For more information about Data Access Object, from the Visual Basic
Editor, click the Office Assistant, type "DAO," click Search, and then
click to view "Data Access Objects Overview."
Q176476 OFF: Office Assistant Not Answering Visual Basic QuestionsFor more information about data access objects in Microsoft Excel version 7.0, click the Index tab in Microsoft Excel Help and type: DAO Additional query words: 8.00 97
Keywords : kbprg kbdta kbdtacode KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |