CodeMine Framework
SQL Server Features

The CodeMine Data Classes include full support for SQL Server and MSDE, and can easily be customized for most other remote data servers.

In addition to full support for Remote Views, the cursor classes also provide extensive support for SQL Passthrough. To use SQL Passthrough, you simply set the cursor type to "SQLPT", and set the cSource property to an SQL statement or remote view name, as described below.

SQLPT - Select Statements

If cSource begins with "SELECT", it is assumed to be an SQL SELECT statement to be sent to the server to create a non-updateable cursor. This type of cursor supports a parameterized WHERE clause, specified either directly in the cSource property, or in the cWhere property. The syntax for the parameterized WHERE clause is the same as any VFP view. Since the SQL statement can be parameterized, these cursors can be defined as children in a relation, just like any other cursor type.

SQLPT - EXEC Statements

If cSource begins with "EXEC", it is assumed to be an SQL Stored Procedure to execute on the server. This also creates a non-updateable result cursor. SQL Stored Procedures can be used to create the equivalent of a server-based parameterized view. That is, you can pass parameters to the Stored Procedure that will be used to determine the result set. The EXEC command can also include VFP level parameters that are evaluated before the command is sent to the server. VFP level parameters use the same "?" prefix syntax as a regular VFP view definition.

Updateable SQLPT Based on a Remote View Definition

If cSource does not begin with SELECT or EXEC, then it is assumed to be a view name. In this case, an updateable SQL passthrough cursor is created, based on the properties of the specified view. This cursor can be treated in most respects just like a regular remote view, however, you can change the WHERE clause at runtime simply by setting the cWhere property and calling the Requery() method. The WHERE clause also supports VFP level parameters, starting with the "?" prefix. This is one of the most powerful variations of the SQLPT cursor, because it give you an updateable remote view with a WHERE clause that can be easily changed dynamically at runtime.

ADO Cursors

You can use ADO recordsets in the same way as SQLPT cursors. To set a cursor to use ADO, simply set the cType property to "ADO". As with SQLPT cursors, an ADO cursor can be created directly from an SQL statement, or automatically from an existing VFP remote view definition, depending on the value of the cSource string.

The CodeMine form and control classes (except for grids) support direct data binding to ADO recordsets. If you need a grid to display an ADO cursor in a Form, you can use an alternate grid control such as the MS FlexGrid ActiveX grid.

 


Read More About Features

Home • Download Sample Application • Order Information • Order Now