When choosing a mechanism to access SQL server you have many options both natively in VFP as well as with these classes. The framework provides two distinct classes:
- wwSQL
wwSQL provides SQL Server access by using straight SQL Passthrough. This mechanism is a very thin layer ontop of VFP's SQL Passthrough via ODBC using that basically manages the Sql Handle and allows for easy error handling and connection management. You also can get access to the SQL handle and perform any SQL Passthrough operation manually with this handle. Because it uses SQL Passthrough almost directly it's very efficient.
ODBC tends to be the most efficient way to get data from SQL Server into VFP. But ODBC in VFP does not support Unicode in any all encompassing way. For this reason the wwADOSql class is available. - wwADOSQL
wwADOSql provides SQL Server access by using a combination of the CURSORADAPTER for reads and plain ADO for non query operations. Although ADO tends to be slower than SQL Passthrough it provides a few features that can't be accomplished with ODBC/SQL Passthrough. OleDB provides true SQL Server connection pooling and allows the ability to work with Unicode data efficiently and reasonably easily.
As a general rule use these guidelines:
- If you have a need for Unicode in your application (using NTEXT and NVARCHAR fields on the server) use wwADOSQL.
- Otherwise wwSQL will probably suit you just fine.
wwSQL and wwADOSql are almost identical in the SQL Syntax they support so switching between them is as easy as switching the object creation and connection string passed in the Connect() method. If you keep a single reference of the SQL object in your application it's easy to swap all data access across the application.
+++ Rick ---