OpenDatabase Method Opens a specified database in a Workspace object and returns a reference to the Database object that represents it. SyntaxSet database = workspace.OpenDatabase (dbname, options, read-only, connect)The OpenDatabase method syntax has these parts.Part Description database An object variable that represents the Database object that you want to open. workspace Optional. An object variable that represents the existing Workspace object that will contain the database. If you don't include a value for workspace, OpenDatabase uses the default workspace. dbname A String that is the name of an existing Microsoft Jet database file, or the data source name (DSN) of an ODBC data source. See the Name property for more information about setting this value. options Optional. A Variant that sets various options for the database, as specified in Settings. read-only Optional. A Variant (Boolean subtype) value that is True if you want to open the database with read-only access, or False (default) if you want to open the database with read/write access. connect Optional. A Variant (String subtype) that specifies various connection information, including passwords. SettingsFor Microsoft Jet workspaces, you can use the following values for the options argument. Setting Description True Opens the database in exclusive mode. False (Default) Opens the database in shared mode. For ODBCDirect workspaces, the options argument determines if and when to prompt the user to establish the connection. You can use one of the following constants.Constant Description dbDriverNoPrompt The ODBC Driver Manager uses the connection string provided in dbname and connect. If you don't provide sufficient information, a run-time error occurs. dbDriverPrompt The ODBC Driver Manager displays the ODBC Data Sources dialog box, which displays any relevant information supplied in dbname or connect. The connection string is made up of the DSN that the user selects via the dialog boxes, or, if the user doesn't specify a DSN, the default DSN is used.
代码迷 - 您身边的软件异常，代码异常，编程异常助手（发现，解决，分享）
Copyright © 2009-2013 DAIMAMI.COM. All rights reserved.