Data Access Component
The LitWare team's goal is to design a generic data access component that supports any ActiveX® Data Objects (ADO) command type: adCmdText, adCmdTable, AdCmdTableDirect, adCmdStoredProc, and adCmdUnknown. The PT application will use SQL Server stored procedures extensively, using the adCmdStoredProc command, but this component also accommodates scripted SQL statements and direct table access. This component is flexible and LitWare can use it in future applications.
In summary, this component must support:
- A variable number of parameters of any data type.
- Any command type. The component must work for all the command types available for the ADO CommandType property: adCmdText, adCmdTable, adCmdTableDirect, adCmdStoredProc, adCmdUnknown, adCommandFile, and adExecuteNoRecords.
- Stored procedure input parameters, output parameters, input/output parameters, and return values.
- Stored procedure parameter syntax.
- SQL statements and stored procedures that execute actions (insert, update, and delete) on SQL Server tables.
- SQL statements and stored procedures that retrieve records from the SQL Server database as a read-only recordset. This recordset provides data when a PT application form is in view mode and for read-only data on the form.
- SQL statements and stored procedures that retrieve records from the SQL Server database as a read/write recordset. This recordset provides data when a PT application form is in edit mode.
- Stored procedures that return code that indicates the execution status of the procedure. The return code can be used to send an appropriate message to the user.
The implemented data access component is named SQLXML. The following topics in Implementation describe how the PT application uses SQLXML: