The information in this article applies to:
SUMMARYIn the versions of Microsoft Excel listed at the beginning of this article, you can use data access objects (DAO) in Microsoft Visual Basic for Applications to retrieve the results of a Parameter QueryDef from Microsoft Access. This article demonstrates how to do so. MORE INFORMATION
A Parameter QueryDef is created in Microsoft Access and saved with the
database file. It consists of a query, which waits for a parameter to be
passed to it, and may or may not include criteria.
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.aspNOTE: This macro utilizes the Northwind.mdb sample database that is installed with Microsoft Office Professional, versions 7.0 and 97. If you accepted the default options when you installed Office 7.0, the file is located in the C:\MSOffice\Access\Samples folder. If you accepted the default options when you installed Office 97, this file is located in the C:\Program Files\Microsoft Office\Office\Samples folder. If your Northwind database is located in a different folder, you must edit the code provided before you attempt to run it. To use DAO with a Visual Basic for Applications macro, you must reference the DAO Object library. With a module sheet active, click References on the Tools menu. If you are using Microsoft Excel 97, select the "Microsoft DAO 3.5 Object Library" check box in the Available References list and click OK. If you are using Microsoft Excel 7.0, select the "Microsoft DAO 3.0 Object Library" check box in the Available References list and click OK.
REFERENCES
For more information about Data Access Objects, 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 Excel 7.0, click the Search button in Help and type: DAO Additional query words: 8.00 97 XL97
Keywords : kbprg kbualink97 kbdta kbdtacode KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |