f$ADORead
f$ADORead
With this function, a list of data records is read into an indexed parameter group with an existing ADO connection. The name of the parameter group must be entered without an index. If the parameter group is not indexed, only one data record is read. If the columns in the table and the parameters in the parameter group are not the same, only the parameters for which there is a column of the same name are filled. Zero values in the database result in the parameter being set to NOVAL. Data records are read until they cannot be found anymore or until the maximum index for the parameter group is reached.
If desired, these data records can be read back later with the f$ADOUpdate function.
Syntax: | SQLNo = f$ADORead(ConnectNo,SQL,PG,NameStatus,NameCount,ReadWrite,[Cursor],[Lock]) | ||
| Argument | Type | Meaning |
| ConnectNo | Integer | Connection identifier from f$ADOConnect |
| SQL | String | SQL command which selects the data records. |
| PG | String | Name of the parameter group to be filled. Entry without index |
| NameStatus | String | Name of a parameter to which the read status is written Values: -1 Create Instance failed -2 Put SQL failed -3 Active Connection failed -4 OPEN failed -5 Get EOF failed -6 parameter group not found 1 There are more data records present than can be written |
| NameCount | String | Name of a parameter to which the count of data records read is written |
| ReadWrite | Integer | Value=1 means that it is possible to update the data records later. In that case, the access must later be closed in the rule-based controls with the f$ADOClose function. |
Optional: | Cursor | Integer | A database cursor can optionally be given with the access. AdOpenUnspecified = -1 adOpenForwardOnly = 0 adOpenKeyset = 1 adOpenDynamic = 2 adOpenStatic = 3 |
Optional: | Lock | Integer | The access data records can optionally be locked. AdLockUnspecified = -1 adLockReadOnly = 1 adLockPessimistic = 2 adLockOptimistic = 3 adLockBatchOptimistic = 4 |
Result: | Integer | Read status: Higher than or equal to 0 : identifier for later write attempts on these data records -1 : successfully read but writing is not possible -10: ADO connection does not exist -12: memory problems, access is not possible | |
Example: | Channel = f$ADOConnect ('Provider=sqloledb;Data Source=Server1;Initial Catalog=Salesmanager ','sa'‚' ') SQL = 'Select * from T_Anschrift where FiBuNr=1' SQLNo = f$ADORead(Channel, SQL ,Addresses, 'Status','Count',1) Addresses[11].Town = 'Stuttgart' Status2 = f$ADOUpdate(Channel,SQLNo,1) | ||