The Content object is included in Commerce Server 3.0 only for backward compatibility with sites created in Commerce Server 2.0. New sites should be constructed using ADOs. Connection strings (not DSNs) should be stored in the ConnectionStringMap (part of the site dictionary) and queries should be stored in the QueryMap Dictionary object.
The AddQuery method adds a query variable to the Content object.
Content.AddQuery(QueryName, QueryText, Timeout, CommandType, MaximumRows, CursorType, CursorSize, RetrievalMethod)
Constant | Value | Description |
---|---|---|
adCmdText | 1 | Evaluates QueryText as a textual definition of a command. |
AdCmdTable | 2 | Evaluates QueryText as a table name. |
AdCmdStoredProc | 4 | Evaluates QueryText as a stored procedure. |
AdCmdUnknown | 8 | Type of command for the QueryText value is not known. This is the default value. |
Constant | Value | Description |
---|---|---|
adOpenForwardReadOnly | 0 | Forward-only cursor. Identical to a static cursor except that you can only scroll forward through records. This improves performance in situations when you only need to make a single pass through a Recordset. (Default.) |
adOpenKeyset | 1 | Keyset cursor. Like a dynamic cursor, except that you cannot view records that other users add, although records that other users delete are inaccessible from your Recordset. Data changes by other users are still visible. |
adOpenDynamic | 2 | Dynamic cursor. Additions, changes, and deletions by other users are visible, and all types of movement through the Recordset are allowed, except for bookmarks if the provider does not support them. |
adOpenStatic | 3 | Static cursor. A static copy of a set of records that you can use to find data or generate reports. Additions, changes, or deletions by other users are not visible. |
The following values can be used for this parameter.
Value | Description |
---|---|
0 | Block retrieval. Indicates that the result set contains no long text or binary data, or that the database fully supports block retrieval of long data. |
1 | Row retrieval. Indicates that the database supports the retrieval of long data, but only on a row-by-row basis. |
2 | Unknown. When you use this value, you effectively ask the system to determine for itself which method to call by searching for columns that contain binary data. |
When you execute a query using the Datasource object’s Execute method, you can simply pass Execute the name you have associated with the query through a call to AddQuery.
Although you can also pass the Execute method the SQL text of a query that you have not added to the Content object, this results in a degradation in performance time. For optimal efficiency, you should always pass Execute query variables stored by AddQuery in the Content object’s query list.
Additionally, if you pass Execute the text of your query, the Datasource object internally uses a set of default values for the Timeout, CommandType, MaximumRows, CursorType, and CursorSize values described previously, and you cannot override these defaults.