Handling cursor requests

An Open ServerConnect application uses a TDS_CURSOR_EVENT to handle cursor requests. The handler includes code to detect which of the cursor commands was issued and to respond with the appropriate information.

The first task inside the event handler is to determine the current cursor and the cursor command that triggered the TDS_CURSOR_EVENT. It does this by calling TDCURPRO with the ACTION argument set to TDS_GET. Open ServerConnect fills the CURSOR_COMMAND field of the Open ServerConnect application CURSOR_DESC structure with the command type.

The application can then decide what other information it needs to retrieve, if any, as well as what data to send back to the client. In some cases, it may need to retrieve parameter formats and parameters; in others, it may want to know the status of the current cursor and the number of rows to fetch. It may only need to send back a TDS_CURSOR_INFO command, or it may need to send back result data or return parameters.