The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you run a macro that uses the OpenDatabase method to open a database, you may be prompted for information even though the Source argument includes a complete connection string to the data source you are using. CAUSE
If either the Exclusive (called to Options in version 97) and Read-only
arguments are omitted, and the Source argument is included, you will be
prompted for any information needed to connect to a data source. The
following example illustrates this behavior.
http://www.microsoft.com/support/supportnet/overview/overview.aspBefore you run the macro, you must create a reference to the DAO Object Library. To do this, activate a module sheet, click References on the Tools menu and select Microsoft DAO 3.5 Object Library (3.0 Object Library in version 7.0).
In this example, all necessary options to make a connection to the data
source called MySQLServer have been specified. However, because the
Exclusive (or Options) and Read-only options are missing, you will be
prompted for the connection information anyway.
RESOLUTION
When you use the Source argument of the OpenDatabase method, specify a
value of True or False for both the Exclusive (Options) and Read-only
arguments.
STATUSThis behavior is by design. MORE INFORMATIONMicrosoft Excel Help for the OpenDatabase method states the following for the Source argument: You must supply the exclusive and read-only arguments to supply a source string. REFERENCESFor more information about the OpenDatabase method, click Index tab in Help, type the following text OpenDatabase methodand double-click the selected text to go to the "Retrieving external data" topic. Additional query words: 8.00 97
Keywords : kbprg kbdta kbdtacode KbVBA xlwin |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |