The class is fairly simple and only performs base tasks, but it exposes the underlying SQL handle so you have full access to all the features of the SQLPassthrough mechanism for setting connection properties etc. This class is mainly geared at making common tasks more manageable.
Custom
wwSql
| Member | Description | |
|---|---|---|
![]() |
AddParameter | Used to set named parameters to be passed into SQL statements. o.wwsql.AddParameter(lvValue,lcName,lcDirection,lnAdoType,lnSize,lnPrecision) |
![]() |
AddSql | Adds text to the current SQL String in cSQL. Pass CLEAR to clear the cSQL property. o.addsql(lcCode) |
![]() |
BeginTransaction | Begins a SQL transaction. o.begintransaction() |
![]() |
Close | Closes an open SQL connection if one is still open. The connection is also automatically closed if the wwSQL object is destroyed. o.Close() |
![]() |
Commit | Commits a SQL transaction. o.commit() |
![]() |
Connect | Connects to a datasource via connection or connect string. o.Connect(lcConnectString, llAsynch, llNoAutoTransactions) |
![]() |
EnableUnicodeToAnsiMapping | This method enables automatic Unicode support for SQL Passthrough operation by picking up nText, nChar and nVarChar data and automatically converting it to the current codepage. o.EnableUnicodeToAnsiMapping(llSet) |
![]() |
Execute | Runs a SQL statement specified in cSQL or passed in as a parameter. This method returns the SQL error code, as well as error information in cErrorMsg, cErrorMsg2 and aErrors. Any connection errors are retried several times. o.execute(lcSQL) |
![]() |
ExecuteNonQuery | Executes a SQL statement that doesn't return a cursor result. This method is more efficient than Execute when dealing with INSERT/UPDATE and Stored procedures that do not return data. o.wwsql.ExecuteNonQuery(lcSQL) |
![]() |
ExecuteStoredProcedure | Executes a Stored Procedure on the Remote Server. Note that you have call AddParameter() for every parameter before calling this method. o.ExecuteStoredProcedure(lcProcedure,llNoCursorReturned) |
![]() |
GetAffectedRows | Returns the affected rows of the last operation. o.GetAffectedRows() |
![]() |
InsertBinaryField | Inserts binary data into a SQL Server Image field.This method updates a single image field on a specific record specified by a WHERE clause. o.InsertBinaryField(lcImageData,lcField,lcTable,lcWhereClause) |
![]() |
InsertDataFromCursor | Imports data from a Fox cursor into a matching SQL table, provided the structures match and data types are compatible. o.InsertDataFromCursor(lcTable) |
![]() |
ReadBinaryField | Reads binary data from a SQL Server Image field and returns it as a Fox string. o.ReadBinaryField(lcField,lcTable,lcWhereClause) |
![]() |
Rollback | Rolls back a SQL transaction started with BeginTransaction. o.rollback() |
![]() |
SetAsyncMode | Sets the connection into Async operation. o.setasynchmode(llAsynch) |
![]() |
SQLBuildInsertStatementFromObj | Creates a SQL INSERT string from a SCATTER NAME type object. o.SQLBuildInsertStatementFromObject(loData,lcTablename) |
![]() |
SqlBuildUpdateStatementFromObj | This method builds a SQL UPDATE string to be sent to the backend application from a SCATTER NAME type object. The object must contain a key field in order for this method to work. o.SqlBuildUpdateStatementFromObject(loData,lcTablename,lcPKField) |
![]() |
SqlCancel | Cancels the currently running SQL request if running in Async mode. o.sqlcancel() |
![]() |
aerrors | Contains full error information after an error occurs. |
![]() |
cconnectstring | An ODBC connection string. Either a DSN or full SQL Connect String. |
![]() |
cerrormsg | Contains an error message if an error occurs. cErrorMsg2 contains more error info. |
![]() |
cerrormsg2 | Contains an error message if an error occurs. cErrorMsg contains more primary info. |
![]() |
cSkipFieldsForUpdates | Used to exclude fields from the auto field list generated in the SQLBuildInsert/UpdateStatementFromObject methods. |
![]() |
csql | The SQL command to be run. |
![]() |
csqlcursor | Cursor to send the result to. If the cursor exists it's overwritten otherwise it's created. |
![]() |
lerror | Error flag set .t. if an error occurs. |
![]() |
lNamedParameters | If set adds parameters in AddParameters as Named Parameters which allows stored procedures to be called with partial parameter lists if optional parameters are supported by the command or Stored Procedure. |
![]() |
luseconnection | .T. if a connection was used to connect, .f. if a DSN, UID, PWD was used. Used internally in reconnection. |
![]() |
nerrorno | Error number if an error occurs. |
![]() |
nodbcerrorno | ODBC Error if an error occurs. |
![]() |
nsqlhandle | The ODBC handle you can use directly with VFP's internal SQL Passthrough properties. |
![]() |
nsqlresult | SQL Result value from SQLExecute or any other command executed. |