Database Commands; Dbaddnew; Dbclose - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

Database Commands

6-17
Database Commands

6-17-1 DBAddNew

Note:
Note:
Note:
Note:

6-17-2 DBClose

Description
Adds a new record to a Recordset. This function will fail if the Recordset is
opened with a lock of 'Read Only'.
Syntax
returnstate = DBAddNew(level)
Remarks
Argument
Type
returnstate
bool
level
text
Typical Examples
Result = DBAddNew("Northwind.Order Details")
Using a Recordset connection level, a new record is added with values from
all fields associated with a property type 'Add'. Point 'Result' is set true if this
was successful.
DBAddNew("Northwind.Order Details.OrderID")
DBAddNew("Northwind.Order Details.ProductID")
DBAddNew("Northwind.Order Details.Quantity")
DBAddNew("Northwind.Order Details.UnitPrice")
DBUpdate("Northwind.Order Details")
Using a Field connection level, each required field is added to the new record
using multiple calls to DBAddNew(). When the record is complete, it is added
by calling the DBUpdate() function
To use DBAddNew() with a Recordset level the Recordset must be configured
to perform this type of operation i.e. it will need to contain fields for any primary
keys and 'non null' values required to create a new record. When used at
Recordset level all fields associated with the Recordset with property type
'Add' are added (as if calling DBAddNew()) and the record is updated (as if
calling DBUpdate()). Points associated with the 'Add' property can be array
points, thus enabling you to add multiple records in one operation.
When using a Field level connection, the operation may be cancelled at any
stage before the DBUpdate() function is called by calling the DBExecute()
command "CancelUpdate".
Only Fields with a property type of 'Add' can be added to a Recordset. The
value(s) of the associated points at the time DBUpdate() is called will be used
to create the record.
Depending on the ADO provider, the added record may not be visible until the
Recordset is requeried. See DBExecute, parameter Requery for more
information.
Description
SECTION 6 Functions and Methods
Description
Optional. 1 if the function is successful
otherwise 0
A text point or constant specifying the
connection level. This should be a field or
recordset level.
103

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents