Visual FoxPro SQL Pass-Through Functions

The following table lists the Visual FoxPro SQL functions that support working with remote data sources, grouped according to task.

Task Function Purpose

Connection management

SQLCONNECT( )

Connects to a data source for SQL pass-through operations.

 

SQLSTRINGCONNECT( )

Connects to a data source using ODBC connection string syntax.

 

SQLDISCONNECT( )

Breaks a connection to an ODBC data source, making the specified connection handle obsolete.

SQLIDLEDISCONNECT( )

Allows a SQL pass-through connection or connections to be temporarily disconnected.

SQL statement execution and control

SQLCANCEL( )

Cancels an asynchronously executing SQL query on an active connection.

 

SQLEXEC( )

Executes a SQL pass-through query on an active connection; returns the number of result sets generated, or 0 if SQLEXEC( ) is still executing (asynchronous processing).

 

SQLMORERESULTS( )

Puts another result set into a cursor. Returns 0 if the statement creating the result set is still executing.

 

SQLPREPARE( )

Pre-compiles the SQL statement on the data source and binds the Visual FoxPro parameters, i.e. saves the actual parameter expressions for all the parameters in the SQL statement.

 

SQLCOMMIT( )

Requests a transaction commitment.

 

SQLROLLBACK( )

Requests a transaction rollback.

Data source information

SQLCOLUMNS( )

Stores a list of column names and information about each to a cursor. Returns 1 if the function succeeds, or 0 if the function is still executing.

 

SQLTABLES( )

Stores the names of tables in the source into a cursor. Returns 1 if the function succeeds, or 0 if the function is still executing.

Miscellaneous control

SQLGETPROP( )

Gets a connection property from an active connection.

 

SQLSETPROP( )

Sets a property of an active connection.

The SQLEXEC( ), SQLMORERESULTS( ), SQLTABLES( ), and SQLCOLUMNS( ) statements can be canceled in synchronous mode by pressing ESC if SET ESCAPE is set to ON. You can cancel these statements at any time in asynchronous mode by issuing SQLCANCEL( ). All other SQL pass-through statements function synchronously and are not interruptible.

See Also

Tasks

How to: Use SQL Pass-Through Functions
How to: Access Stored Procedures on Remote Servers with SQL Pass-Through Functions
How to: Return Multiple Result Sets

Concepts

Using Result Sets
Processing Multiple Result Sets

Other Resources

Using SQL Pass-Through Technology
Enhancing Applications Using SQL Pass-Through Technology
Planning Client/Server Applications
Upsizing Visual FoxPro Databases
Creating Views