Description

Create a new McDBDatabase, both mapping and files, in this McDBDatabases collection.

Return Type

A McDBDatabase object.  

Syntax

object.Create (LogicalName, PhysicalName, [Server])

The Create Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBDatabases.
LogicalNameRequired. A String value.

The logical name for the database mapping. This value must be unique within this collection, and will be used to uniquely identify a database mapping. That is, it is NOT possible to have two databases (i.e. two different physical paths) with the same logical name. This value is case-sensitive. That is Database and DataBASE are different, discrete Logical Names.

PhysicalNameRequired. A String value.

A fully qualified path to the database. For LOCAL databases, this path should specify a directory which contains the actual database files. If this parameter is omitted or empty, the local configuration file is searched for a mapping with the specified LogicalName. If Server is not LOCAL, this value is the LogicalName of the database in the configuration file on the database server.

ServerOptional. A String value.

The DNS name or IP Address of the machine serving the database (to specify a remote database served by an IQbase database server). If this parameter is not passed in, its value will be retrieved from the local configuration file, if present. If no suitable mapping can be found, a LOCAL server is assumed.

Remarks

The McDBDatabase returned by this method will be Open. If the path indicated by PhysicalName does not contain database files (e.g. the directory does not exist), database files will be created. When database files are created, if a mapping for Logical already exists, it will be overwritten with the new information.

Exceptions

Error Value Description
E_INVALIDARG &H80070057 One of the arguments is invalid. No PhysicalName was passed in for a database, and no mapping for the Logical name is present in the local configuration file. The Logical or Server name passed contains an illegal character (e.g. a colon “:”).
E_FAIL &H80004005 The Logical name is not unique within this collection.
E_UNEXPECTED &H8001FFFF A framework or file system error occurred creating the database files or writing its configuration mapping.