Share via


Execute Method (RDS)

Executes the request and creates an ADO recordset for use in ADO 2.5 and later.

Syntax

object.Execute(ConnectionString As String, HandlerString As String, QueryString As String, lMarshalOptions As Long, Properties, TableId, lExecuteOptions As Long, pParameters, [lcid As Long], [pInformation])

Parameters

  • ConnectionString
    A string used to connect to the OLE DB provider where the request will be sent for execution. If a handler is specified using HandlerString it may edit or replace the connection string.

  • HandlerString
    The string identifies the handler to be used with this execution. The string contains two parts. The first part contains the name (ProgID) of the handler to be used. The second part of the string contains arguments to be passed to the handler. How the arguments string is interpreted is handler specific. The two parts are separated by the first instance of a comma in the string (although the arguments string may contain additional commas). The arguments are optional.

  • QueryString
    A command in the command language supported by the OLE DB provider identified in the connection string. For SQL-based providers, it might contain a T-SQL command statement, but for non-SQL providers (for example, MSDataShape) this may not be a T-SQL query statement.

    Also if a handler is being used (and it is highly recommended that a handler be used), the handler may alter or replace the value specified here. For example, the handler typically replaces QueryString with a query string from its .Ini file. By default, the Msdfmap.ini file is used.

  • lMarshalOptions
    Used to set the marshaling options on the rowset/recordset being returned.

  • TableID
    A variant of type either VT_EMPTY or VT_BSTR. If this value is of type VT_EMPTY, it is ignored. If it is of type VT_BSTR, then the recordset is created using adCmdTableDirect using the value specified here and the QueryString parameter is ignored.

  • lExecuteOptions
    A bit mask of execution options:

    1=ReadOnly – the recordset will be opened using adLockReadOnly.

    2=NoBatch – The recordset will be opened using adLockOptimistic.

    4=AllParamInfoSupplied - the caller guarantees that parameter information for all parameters is supplied in pParameters.

    8=GetInfo – parameter information for the query will be obtained from the OLE DB provider and returned in the pParameters parameter. The query is not executed and no recordset is returned.

    16=GetHiddenColumns – The recordset will be opened using adLockBatchOptimistic and any hidden columns will be included in the recordset.

    While it is clear that ReadOnly, NoBatch and GetHiddenColumns are mutually exclusive options, it is not an error to set more than one of them. If multiple options are set GetHiddenColumns take precedence over all others, followed by ReadOnly. If no options are specified, bye default, the recordset is opened using adLockBatchOptimistic but hidden columns are not included in the recordset.

  • pParameters
    A variant containing a safe array of parameter definitions. If the GetInfo option was specified in lExecuteOptions, this parameter is used to return the parameter definitions obtained from the OLE DB provider. Otherwise, this parameter may be empty.

  • lcid
    The LCID used to build any errors that are returned in pInformation.

  • pInformation
    A pointer to information error returned by Execute. If NULL, no error information is returned.

Remarks

The HandlerString parameter may be null. What happens in this case depends on how the RDS server is configured. A handler string of “MSDFMAP.handler” indicates that the Microsoft supplied handler (Msdfmap.dll) should be used. A handler string of "MASDFMAP.handler,sample.ini" indicates that the Msdfmap.dll handler should be used and that the argument "sample.ini" should be passed to the handler. MSDFMAP.dll will interpret the argument as a direction to use the sample.ini to check the connection and query strings.

See Also

Applies To: DataFactory Object (RDSServer)