Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

SQLMoreResults()

This long-named function is used only in non-batch mode with SQL Pass-Through. It asks ODBC for the next set of results when you’ve sent a bunch of commands to the server at once.

Usage

nResult = SQLMoreResults( nConnectionHandle [, cCursor ] )

Parameter

Value

Meaning

nConnectionHandle

Numeric

The existing connection handle for the remote database being queried.

cCursor

Character

The name of a cursor in which to put the query results.

Omitted

Use the name passed with the original SQLExec. If that was omitted, too, use "SQLResult".

nResult

0

The command is still executing.

1

The current command has finished.

2

All commands have finished.

Negative

An error occurred.

To the extent we’ve been able to test, it appears to work as advertised, except for the completely undocumented cCursor parameter. The cursor name is limited to 10 characters.

Example

* This example uses the ever-popular PUBS database
nConn = SQLConnect("LocalServer")
* Turn batch mode off
SQLSetProp(nConn, "BatchMode",.F.)
* Here the first Query returns SQLResult cursor of authors
SQLEXEC(nConn, "select * from authors;" + ;
               " select * from publishers")
* Now we direct the second result set to the named cursor
? SQLMoreResults(nConn, "rv_Publs")

See Also

SQLConnect(), SQLExec(), SQLGetProp(), SQLSetProp()