FileAdapter.OpenNewAdgDataSet Method

Estimated reading time: 2 minutes

Definition

Namespace: ASNA.DataGate.Client
Assembly: ASNA.QSys.DataGate.Client.dll

Opens a file and creates a AdgDataSet corresponding to the record formats of the opened file.

void OpenNewAdgDataSet(AdgDataSet& ds)

Parameters

Type Parameter name Description
AdgDataSet& ds The created AdgDataSet that corresponds to the formats of the file opened.

Remarks

Open, OpenNewAdgDataSet, and OpenSimpleQuery are the three methods available for opening database files with FileAdapter.

OpenNewAdgDataSet opens the file and creates an AdgDataSet instance used by FileAdapter for containing file record data for access operations. The AdgDataSet instance so created is guaranteed to reflect the current record formats of the file. This is in contrast to the Open method, which accepts a pre-existing AdgDataSet instance parameter, and it is the responsibility of the program to determine the compatibility of the AdgDataSet and file record formats. Generally, OpenNewAdgDataSet is designed for use in applications, whereas Open is suitable for development environments such as Visual RPG.

Open and OpenNewAdgDataSet observe the current value of the AccessMode property. This property specifies how access to the file is enforced by the database. For example, to allow records to be deleted by the FileAdapter, use a value for AccessMode that includes the AccessMode.Delete flag.

Open and OpenNewAdgDataSet also observe the OpenAttributes property, to effect other characteristics of the opened file. These characteristics include “record blocking” for read access, and “level checking” for file format verification. The value of OpenAttributesis an object of type FileOpenAttr.

Record blocking can significantly improve sequential access efficiency especially when utilized against a network database. If the value of FileOpenAttr.BlockingFactor is set in the object referenced by OpenAttributes, then read-access record blocking will be used to access the opened file.

If the user provides a value to the FileOpenAttr.FormatIDs property of the object referenced by OpenAttributes, then the given format identifier(s) will be used to “level check” the format(s) of the file. If the file is not at the same level when the open operation occurs, the database will return an error.

See Also