Use Create to create a new database object reflecting the current state of IAdgObject.
[C#]
Public void IAdgObject Create();
[Visual Basic]
Public Sub Create() As System.Void
[Visual RPG] BegSr Create Access(*Public) Type(System.Void)
- None.
Exception Type | Condition |
---|---|
dgException |
See table below. |
ASNA.DataGate.Common.dgException is thrown to signal normal procedural conditions, in addition to error conditions. The following table summarizes these conditions, and the corresponding value of the dgException.Error property.
Value of dgException.Error | Condition |
---|---|
dgEgNOFDEF |
Create is invoked to create a file, but there is no file definition. The file definition may be set during IAdgObject construction (with AdgFactory.ReadXml) or with the IFileObject.ReadDefinition method. See also IFileObject.WriteDefinition, IAdgObject.WriteXml, and Remarks below. |
dgEgNOATTR |
Create is invoked to create a file, but there are no creation attributes. Creation attributes may be set during IAdgObject construction (with AdgFactory.ReadXml) or with the IFileObject.ReadCreationAttributes method. See also IFileObject.WriteCreationAttributes, IAdgObject.WriteXml, and Remarks below. |
dgErBADSRC |
Create is invoked to create a logical file, but no base files have been specified. Base files may be specified at IAdgObject construction (with AdgFactory.ReadXml) or with the IAdgObject.Bases property. See also IAdgObject.WriteXml and Remarks below. |
dgEINVARG |
The path name of the database object specified when IAdgObject was created is invalid. |
dgEmDUPOBJ |
The path name of the database object specified when IAdgObject was created references an existing database object. |
dgEsAS400ERROR |
The database provider encountered a system-level error. Details provided in the dgException.Message property. |
dgEmNODIRADD |
Create is invoked to create a library or file, but the session does not have one of the requisite authorities to the parent library:
|
dgEmBUSYOBJ |
The attempt to obtain an exclusive-read lock on the new object's parent failed. |
dgEmBASENOTPH |
Create is invoked to create a logical file but one or more of the base files is not a physical file. |
dgEmNOBASEAUTH |
Create is invoked to create a logical file but the current session is lacking one or more of the following authorities:
|
dgEmNOPERMINTEMP |
Create is invoked to create a logical file but one or more of the base files is a temporary object. |
dgEmBADFRMTID |
Create is invoked to create a logical file but one or more of the base format identifiers of the file definition do not match the base files specified. |
dgEmNOMEMADD |
Create is invoked to create a member but the current session is lacking one or more of the following authorities:
|
dgEgBADREL, dgEgBADFARM, dgEgBADGROVE, dgEgBADGROVE, or dgEINTERNAL |
Create is invoked to create a file member but an internal database exception was raised. The database should be repaired. |
dgENOMEM |
The database provider raised an out-of-memory exception. |
To create a database object, first create an instance of IAdgObject using one of the methods of AdgFactory (NewFile, NewDirectory, NewMember, or ReadXml). The IAdgObject created this way must not refer to an existing database object, or Create will raise an exception. If IAdgObject was created via ReadXml , then no further definition of the object may be necessary since the provided XML description contains all non-security details (see WriteXml). Also note that ReadXml provides the option of invoking Create automatically as the XML description is read and validated from the stream (see XmlOptions.CreateObjects enumeration). Instantiating IAdgObject in any other way may require the use of appropriate IAdgObject properties and methods to fully define the object.
A "bare" IAdgObject instance, created with NewFile, NewDirectory, or NewMember, defines the path name and database connection used. But depending on the object type, further embellishment may be required using the methods and properties listed below. The list details whether the property or method should be used before or after Create. Note that except for security-related details, using these properties and methods may not be necessary when AdgFactory.ReadXml is used to create IAdgObject. Also, many of these methods and properties are optional and/or provider-dependent.
Database object to create | AdgFactory method | IAdgObject implementation | Methods and properties defining the object before and after Create |
---|---|---|---|
Library |
NewDirectory |
Text, AuthorityEntries, GrantAuthority, and RevokeAuthority, afterCreate. |
|
File |
NewFile |
ReadDefinition (required), ReadCreationAttributes
(required), and Bases (required for logical files only) prior
to Create. |
|
Member |
NewMember |
For logical members, Bases(required) prior to Create. |
Namespace: ASNA.DataGate.Client
Assembly: ASNA DataGate Client
Platforms: Windows Server 2008 R2, Windows Server 2012, Windows 7, Windows 8 Pro, Windows 8.1 Pro
-
IAdgObject Class
IAdgObject Class Members
WriteXml Methods
Text Property
AuthorityEntries Property
GrantAuthority Method
RevokeAuthority Method
Bases Property
IFileObject Class
ReadDefinition Method
WriteDefinition Method
ReadCreationAttributes Method
WriteCreationAttributes Method
AdgFactory Class
NewFile Method
NewDirectory Method
NewMember Method
ReadXml Methods
IDirectory Class
IMember Class
Extension Property
XmlOptions Enumeration
ASNA.DataGate.Client Namespace