ADO API Reference (ADO Dynamic Properties)

zhaozj2021-02-17  69

Name properties - dynamics

Specifies the name of the Recordset object.

return value

Returns a string value as a Recordset name.

Description

The name is in the connection or before the Recordset is turned off.

The Name property is primarily used for the reconstruction characteristics of the Microsoft Data Shaping Service for OLE DB service provider. To participate in the reconstruction, the name must be unique.

This attribute is read-only, but can be set indirectly when creating the Recordset. For example, if you use the Shape command phrase to create a RECORDSET and use the "AS" keyword name alias, the alias will be assigned to the Name property. If the alias is not declared, or the alias conflicts with the existing name, the Name property will determine the name generated by the Shape provider.

When you want to reference the Recordset in the shape command, use the name property, but because it is generated by MSDataShape, the user does not know its name. At this time, the string returned by the Name property should be used to make a command to generate a shape command.

When the CursorLocation property is set to AduseClient, Name is a dynamic property that adds to the Properties collection of the Recordset object.

Unique Table, Unique Schema, Unique Catalog Property - Dynamic

The user can directly control the modification of a specific basic table in the Recordset obtained by performing JOIN operations throughout the plurality of basic tables.

Unique Table Specifies the name of the basic table that allows updates, insert, and delete. UNIQUE Schema specifies the mode, the name of the owner of the table. UNIQUE CATALOG Specifies the directory, that is, the name of the database containing the table.

Setting and return value

Set or returns a string value, which is the name of the table, mode, or directory.

Description

The basic table you want is uniquely identified through its directory, mode, and table name. After setting the UNIQUE TABLE properties, you can use the value of the Unique Schema or the Unique Catalog property to find the basic table. You need to set one of the UNIQUE Schema and UNIQUE Catalog properties or two properties, but this is not necessary.

The primary key of UNIQUE TABLE is used as the primary key of the entire Recordset. This key can be used for any method that requires primary key.

After setting UNIQUE TABLE, addnew, delete, resync, usdate, and updatebatch methods can only affect the named table.

If a unique basic table is not found, a runtime error will occur.

These dynamic properties are appended to the Properties collection of the Recordset object when the CursorLocation property is set to AduseClient.

Resync Command Properties - Dynamic

Specifies the command string provided by the user, the resync method issues the string to refresh the data in the table named by the UNIQUE TABLE dynamic property.

Setting and return value

Set or return a string, which is a command string.

Description

The Recordset object is the result of performing Jion operations for multiple basic tables. The affected row depends on the AffectRecords parameters of the RESYNC method. If the unique table and the resync command property is set, the standard RESYNC method will be executed.

The Resync Command Properties command string is the unique identification command or stored procedure that is being refreshed, and returns a single line that contains the number and sequence of the same column as a row to refresh. The command string contains the parameters of each primary key column in the UNIQUE Table, otherwise the runtime error will be returned. The parameter will automatically populate the primary key value to refresh.

Two SQL-based examples are as follows: 1) RECORDSET is defined by the command:

Select * from customers Join Ors ON

Customers.customerid = Orders.customerid

WHERE city = 'seattle'

Order by Customerid

The Resync Command property is set to:

"SELECT * FROM

(Select * from customers Join ORDERS

On Customers.customerid = Orders.customerid

City = 'seattle' Order by Customerid)

Where orders.Orderid =? "

UNIQUE TABLE is ORDERS, and its primary key ORDERID is parameterized. Sub selection provides a simple method, ensuring that the returned columns in the program have the same number and order as the original command.

2) Recordset defines by the stored procedure:

Create Proc Custorder @customerid Char (5) AS

Select * from customers Join Ors ON

Customers.customerid = Orders.customerid

Where customerid = @customerid

The RESYNC method should perform the following stored procedures:

Create Proc CustOrdersResync @ORDID INT AS

Select * from customers Join Ors ON

Customers.customerid = Orders.customerid

Where orders.ordid = @ORDID

The Resync Command property is set to:

{Call CustOrDersResync (?)} "

Once again, UNIQUE TABLE is ORDERS, and its primary key ORDERID is parameterized.

When the CursorLocation property is set to AduseClient, RESYNC Command is a dynamic properties of the Properties collection that adds to the Recordset object.

Update resync properties - dynamics

Specifies whether to perform implicit RYNC method after the UpdateBatch method, and if so, the range of operations.

Setting and return value

Set or return one of the following CereSyncenum values:

Constant Description AdResyncnone does not call RESYNC. AdResyncAutoInCrement (default) Row RESYNC is used for all successfully inserted RESYNCs, including them to automatically deliver a column. AdResyncConflicts is RESYNC for all row modes that cause an update or delete operation due to concurrent conflict. AdResyncUpdates uses RESYNC for all successful updates. AdResyncInserts uses RESYNC for all successfully inserted rows, including their identical columns. AdResyncall calls RESYNC for each line that hangs change.

Description

This property can only be applied only if the Unique Table dynamic properties have been set.

AdResyncautoInCrement and AdResyncConflicts can be used simultaneously. AdResyncall, AdResyncupdates, AdResyncinserts, and AdResyncconFlicts can be used simultaneously.

Constant AdResyncConflicts stores the resync value as a basic value, but does not overwrite the hang change. When the CursorLocation property is set to AduseClient, Update Resync is a dynamic properties that append to the Recordset object Properties collection.

转载请注明原文地址:https://www.9cbs.com/read-29972.html

New Post(0)