?? manual.htm
字號:
BOOL IsEOF() const;
</pre>
<dd>Returns TRUE if the current cursor is positioned before the first row, or after the last row.
<dt><pre>BOOL Move(SQLINTEGER nOffset, BOOL bRefresh=FALSE);</pre>
<dd>Moves the cursor position to the row nOffset from the current row.
This function is only valid for scrollable cursor.
<dd><b>Parameters</b>
<dl><dt><i>nOffset</i>
<dd>Specifies the offset from the current row.
<dt><i>bRefresh</i>
<dd>Specifies whether refresh the local row cache by acquiring data from server.
</dl>
<dt><pre>
BOOL MoveFirst();
BOOL MoveLast();
BOOL MovePrevious();
BOOL MoveNext();
</pre>
<dd>Moves to the first, last, previous, next row.
Except MoveNext these functions are only valid for scrollable cursor.
<dd><a href="#CallSP">See sample</a>
<dt><pre>BOOL Refresh();</pre>
<dd>Refreshes the status of current row. This function is only valid for scrollable cursor.
<dt><pre>BOOL GetBookmark(SqlBookmark& rBookmark);</pre>
<dd>Gets the bookmark of the current cursor position. This function is only valid for scrollable cursor.
<dd><b>Parameters</b>
<dl><dt><i>rBookmark</i>
<dd>a reference to retrieve the bookmark.
</dl>
<dt><pre>BOOL SetBookmark(const SqlBookmark& rBookmark);</pre>
<dd>Moves to the position specified by a bookmark. This function is only valid for scrollable cursor.
<dd><b>Parameters</b>
<dl><dt><i>rBookmark</i>
<dd>The bookmark got from GetBookmark() before.
</dl>
<dt><pre>
BOOL Update();
BOOL Delete();
</pre>
<dd>Updates or deletes the current row. These functions are only valid for updatable cursor.
<dt><pre>
int GetFields() const;
CSqlFields& Fields();
</pre>
<dd>Returns the collection of fields (columns) bound on this recordset.
</dl>
<!--------------------------------------------------------------------------->
<h2><a name="#CSqlVariant">CSqlVariant class</a></h2>
<p>CSqlVariant is the base class of CSqlParameter and CSqlField. It represents a variant that has
standard SQL data type.
<dl>
<dt><pre>
CSqlVariant();
CSqlVariant(const CSqlVariant& rVar);
</pre>
<dd>Creates a CSqlVariant object.
<dt><pre>
SQLSMALLINT GetSqlType() const;
SQLSMALLINT GetDataType() const;
SQLUINTEGER GetPrecision() const;
SQLSMALLINT GetScale() const;
</pre>
<dd>Returns the SQL data type, the C data type, precision, scale of the variant.
<dt><pre>SQLINTEGER GetMaxSize() const;</pre>
<dd>Returns the maximum length (in bytes) of the buffer of the variant.
<dt><pre>SQLINTEGER GetDisplaySize() const;</pre>
<dd>Returns the length (in bytes) needed to display the variant data in character form.
<dt><pre>SQLINTEGER GetLength() const;</pre>
<dd>Returns the length (in bytes) of the variant value. (If the variant is a locator, the length
of locator is returned, not the LOB data). The returned value might be SQL_NULL_DATA,
indicates the value is null.
<dt><pre>BOOL IsNull() const;</pre>
<dd>Returns TRUE if the value is null.
<dt><pre>void SetNull();</pre>
<dd>Sets the value to null.
<dt><pre>BOOL SetValue(const void* pValue, SQLINTEGER nValueSize=0);</pre>
<dd>Sets the value of the variant without any conversion.
<dd><b>Parameters</b>
<dl><dt><i>pValue</i>
<dd>Pointer to the value buffer.
<dt><i>nValueSize</i>
<dd>Specifies the length of the value if it is variable (string or LOB).
</dl>
<dt><pre>
BOOL FromInteger(int nValue);
BOOL FromDouble(double dValue);
BOOL FromString(const char* pszValue);
</pre>
<dd>Sets the value by converting from an int, double, char* parameter.
<dt><pre>int ToString(std::string& strValue);</pre>
<dd>Converts the value to a string.
<dt><pre>
operator short() const;
operator int() const;
operator double() const;
operator const char*() const;
</pre>
<dd>Converts the value to short, int, double, char* data type.
<dt><pre>
SQLCHAR* GetBuffer() const;
const DATE_STRUCT* GetDate() const;
const TIME_STRUCT* GetTime() const;
const TIMESTAMP_STRUCT* GetTimeStamp() const;
</pre>
<dd>Returns the pointer of the value and casts to different data types.
</dl>
<!--------------------------------------------------------------------------->
<h2><a name="#CSqlParameter">CSqlParameter class</a></h2>
<p>CSqlParameter is inherited from CSqlVariant class.
<dl>
<dt><pre>
CreateParameter();
CreateParameter(const CSqlParameter& rValue);
</pre>
<dd>Creates a CSqlParameter object.
<dt><pre>BOOL CreateParameter(SQLSMALLINT nSqlType, SQLSMALLINT nIoType, SQLUINTEGER nPrecision=0, SQLSMALLINT nScale=0);</pre>
<dd>Initializes a parameter.
<dd><b>Parameters</b>
<dl><dt><i>nSqlType</i>
<dd>Specifies the SQL data type of the parameter.
<dt><i>nIoType</i>
<dd>Specifies the input/output type of the parameter. It can be one of the following values:
<dd>SQL_PARAM_INPUT
<dd>SQL_PARAM_OUTPUT
<dd>SQL_PARAM_INPUT_OUTPUT
<dt><i>nPrecision</i>
<dd>Specifies the precision of the parameter.
<dd>For a binary or single byte string, it is the maximum length in bytes;
<dd>For a double byte string, it is the maximum length in double-bytes;
<dd>For NUMERIC or DECIMAL, it is the decimal precision;
<dd>For fixed-length data type, this argument is ignored.
<dt><i>nScale</i>
<dd>Specifies the scale if <i>nSqlType</i> is SQL_NUMERIC, SQL_ECIMAL, or SQL_TIMESTAMP.
</dl>
<dd><a href="#Query">See sample</a>
<dt><pre>BOOL CreateFileParam(SQLSMALLINT nSqlType);</pre>
<dd>Initializes a file-binding parameter. The value of this parameter is the file name, not the LOB data.
<dd><b>Parameters</b>
<dl><dt><i>nSqlType</i>
<dd>Specifies the SQL data type of the parameter. It only can be SQL_BLOB, SQL_CLOB, or SQL_DBCLOB.
</dl>
<dt><pre>
CSqlParameter& operator=(const CSqlParameter& rValue);
CSqlParameter& operator=(int nValue);
CSqlParameter& operator=(double nValue);
CSqlParameter& operator=(const char* pszValue);
</pre>
<dd>Sets the value of the parameter.
</dl>
<!--------------------------------------------------------------------------->
<h2><a name="#CSqlField">CSqlField class</a></h2>
<p>CSqlField is inherited from CSqlVariant class.
<dl>
<dt><pre>
CSqlField();
CSqlField(const CSqlField& rData);
</pre>
<dd>Creates a CSqlField object.
<dt><pre>BOOL CreateField(PCSTR pszFieldName, SQLSMALLINT nDataType, SQLINTEGER nDataSize=0);</pre>
<dd>Initializes a field (column) object.
<dd><b>Parameters</b>
<dl><dt><i>pszFieldName</i>
<dd>Specifies the name of the field. It can be a column name in a table, or a SQL expression.
<dt><i>nDataType</i>
<dd>Specifies the C data type identifier of the field.
<dt><i>nDataSize</i>
<dd>Specifies the maximum length in bytes of the field. This argument is ignored if <i>nDataType</i>
specifies a fixed-length data type.
</dl>
<dd><a href="#Query">See sample</a>
<dt><pre>BOOL CreateField(CSqlCommand* pStmt, int nOrdinal);</pre>
<dd>Initializes a field according to the attribute of a specified column in a recordset.
<dd><b>Parameters</b>
<dl><dt><i>pStmt</i>
<dd>Pointer to the recordset object which contains the specified column.
<dt><i>nOrdinal</i>
<dd>The ordinal number identifying the column.
</dl>
<dt><pre>BOOL CreateFileField(PCSTR pszFieldName, SQLUINTEGER nFileOption=SQL_FILE_OVERWRITE);</pre>
<dd>Initializes a file-binding field. The value of this field is the file name, not the LOB data.
<dd><b>Parameters</b>
<dl><dt><i>pszFieldName</i>
<dd>Specifies the name of the field. It is usually the name of a LOB column in a table.
<dt><i>nFileOption</i>
<dd>Specifies the file access option. It can be one of the following values:
<dl><dt>SQL_FILE_CREATE<dd>Create a new file. If a file by this name already exists, SQL_ERROR will be returned.
<dt>SQL_FILE_OVERWRITE<dd>If the file already exists, overwrite it. Otherwise, create a new file.
<dt>SQL_FILE_APPEND<dd>If the file already exists, append the data to it. Otherwise, create a new file.
</dl>
</dl>
<dd><a href="#LOB">See sample</a>
<dt><pre>
CSqlField& operator=(const CSqlField& rValue);
CSqlField& operator=(int nValue);
CSqlField& operator=(double nValue);
CSqlField& operator=(const char* pszValue);
</pre>
<dd>Sets the value of the field.
</dl>
<!--------------------------------------------------------------------------->
<h2><a name="#CSqlLocator">CSqlLocator class</a></h2>
<p>CSqlLocator has no base class.
<dl>
<dt><pre>CSqlLocator();</pre>
<dd>Creates a CSqlLocator object.
<dt><pre>BOOL Open(CSqlDatabase* pDB, const CSqlVariant& rVariant);</pre>
<dd>Initializes the CSqlLocator object.
<dd><b>Parameters</b>
<dl><dt><i>pDB</i>
<dd>Specifies a database connection to manipulate the locator.
<dt><i>rVariant</i>
<dd>Specifies a variant (usually a field) object which represents the locator.
</dl>
<dt><pre>SQLINTEGER GetLength();</pre>
<dd>Returns the total length of the LOB data represented by the locator.
<dt><pre>SQLINTEGER GetSubString(SQLPOINTER pBuff, SQLINTEGER nStartPos, SQLINTEGER nLength);</pre>
<dd>Gets a portion from the LOB data.
<dd><b>Parameters</b>
<dl><dt><i>pBuff</i>
<dd>Specifies a buffer to retrieve returned string.
<dt><i>nStartPos</i>
<dd>Specifies the position of the first byte to be returned.
<dt><i>nLength</i>
<dd>Specifies the length of the string to be returned.
</dl>
<dt><pre>BOOL Free();</pre>
<dd>Frees the locator object.
<dd><a href="#LOB">See sample</a>
</dl>
<!--------------------------------------------------------------------------->
<h2><a name="#CSqlErrorInfo">CSqlErrorInfo class</a></h2>
<p>CSqlErrorInfo has no base class.
<dl>
<dt><pre>
CSqlErrorInfo();
CSqlErrorInfo(const CSqlErrorInfo& rEI);
</pre>
<dd>Creates a CSqlErrorInfo object.
<dt><pre>const char* GetErrorText();</pre>
<dd>Returns the text of an error object.
<dd><a href="#Error">See sample</a>
</dl>
<!------------------------------- That's it! --------------------------->
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -