📄 sqlserver_oledb.html
字号:
<TR>
<TD>LongBinary</TD>
<TD>SA_dtLongBinary</TD>
</TR>
<TR>
<TD>LongChar</TD>
<TD>SA_dtLongChar</TD>
</TR>
<TR>
<TD>BLob (Binary Large object)</TD>
<TD>SA_dtBLob</TD>
</TR>
<TR>
<TD>CLob (Character Large object)</TD>
<TD>SA_dtCLob</TD>
</TR></TABLE></P>
<P>The table below shows how SQLAPI++ data types
correspond with <STRONG>SQL Server's (OLE DB)</STRONG>
original data types:</P>
<P><EM>SA_dtLongBinary</EM>
<= > IMAGE<BR><EM>SA_dtLongChar</EM> <= > TEXT<BR><EM
>SA_dtBLob</EM> = > IMAGE<BR><EM>SA_dtCLob </EM>=> TEXT</EM></P>
<P>
For more details see <A href="../HowTo/blobs.html">How To - Working with Long or Lob(CLob, BLob) data</A>
, <A href="../HowTo/bind.html">How To - Binding input parameters</A>.</P>
<P> </P>
<H3><A
name="Returning output parameters">Returning output
parameters</A> </H3>
<P><STRONG>SQL Server</STRONG>
stored procedures can have integer return codes and
output parameters. The return codes and output parameters are sent
in the last packet from the server and are therefore not available
to the application until all result sets from stored procedure (if
any) are completely processed using <A href="../OnLineDoc/Command_FetchNext.html" >SACommand::FetchNext</A>
method.</P>
<P>SQLAPI++ Library automatically creates <A href="../OnLineDoc/Param.html" >SAParam</A>
object to represent procedure
status return code or function return value. You can refer to this
<A href="../OnLineDoc/Param.html" >SAParam</A>
object using SQLAPI++ predefined
name <STRONG>"RETURN_VALUE"</STRONG>.
</P>
<P>For more details see <A
href="../OnLineDoc/Command_Execute.html">SACommand::Execute</A>,
<A href="../OnLineDoc/Command_FetchNext.html">SACommand::FetchNext</A>,
<A href="../OnLineDoc/Param_Usage.html">SAParam
object</A>, <A
href="../HowTo/return_param.html">How To - Returning Output Parameters</A>.</P>
<P> </P>
<H3><A name="Cancelling queries">Cancelling
queries</A> </H3>
<P>Using <A
href="../OnLineDoc/Command_Cancel.html">SACommand::Cancel</A>
method
you can cancel the following types of processing on a statement: </P>
<UL type=disc>
<LI>A function running asynchronously on
the statement.<BR>
<LI>A function running on the statement on
another thread. </LI></UL>
<p>SQLAPI++ calls <STRONG>ICommand::Cancel</STRONG>
function to cancel a query. To get more
details see <STRONG>ICommand::Cancel</STRONG>
function
description in <STRONG>SQL Server OLE DB</STRONG>
documentation.</p>
<P>For more details see <A href="../OnLineDoc/Command_Cancel.html" >SACommand::Cancel</A>, <A
href="SQLServer_OleDb.html#Connection and command options">SQL Server (OLE DB)
connection and command options</A>.</P>
<P> </P>
<H3><A
name="Connection and command options">Connection, command, parameter and field
options</A> </H3>
<P>A server specific option can relate to a
connection, command, parameter or field. We recommend you
specify each option in an appropriate object, although it is
possible to specify them in the parental object as well. In that
case the option affects all the child objects. </P>
<P>A connection related option must be specified
in a <A href="../OnLineDoc/Connection.html">SAConnection</A>
object. </P>
<P>A command related option may be specified in
either <A href="../OnLineDoc/Connection.html">SAConnection</A>
object or <A href="../OnLineDoc/Command.html">SACommand</A>
object. If it is specified
in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object it affects all
the commands on that connection. </P>
<P>A parameter related option may be specified in
<A href="../OnLineDoc/Connection.html">SAConnection</A>
object, <A href="../OnLineDoc/Command.html">SACommand</A>
object or <A href="../OnLineDoc/Param.html">SAParam</A>
object. If it is specified in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object it affects all
the commands and therefore all the parameters on that connection. If
it is specified in <A href="../OnLineDoc/Command.html">SACommand</A>
object it affects all the
parameters on that command. </P>
<P>A field related option may be specified in
<A href="../OnLineDoc/Connection.html">SAConnection</A>
object, <A href="../OnLineDoc/Command.html">SACommand</A>
object or <A href="../OnLineDoc/Field.html">SAField</A>
object. If it is specified in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object it affects all
the commands and therefore all the fields on that connection. If it
is specified in <A href="../OnLineDoc/Command.html" >SACommand</A>
object it affects all the
fields on that command. </P>
<P>Specific options for <STRONG>SQL Server (OLE DB)</STRONG>:</P>
<P>
<TABLE border=1 cellPadding=5 width="100%">
<TBODY>
<TR bgColor=#000094>
<TD width="17%">
<P><STRONG><FONT color=white face="">Option name / Scope</FONT>
</STRONG></P></TD>
<TD>
<P><STRONG><FONT color=white face=""> Description</FONT>
</STRONG></P></TD></TR>
<TR>
<TD><STRONG>
<P align=center>
<STRONG>UseAPI</STRONG>
</P></STRONG>
<P align=center>
Connection
related
</P>
</TD>
<TD>
<P>
Forces SQLAPI++
Library to use OLE DB or DB-Library
API.<BR >
<BR><EM>Valid values</EM>: "OLE
DB" and "DB-Library".
<BR><EM>Default value</EM> :
"OLE
DB".
SQLAPI++ uses SQLOLEDB API by default .</P></TD></TR>
<TR>
<TD> <STRONG><P align=center><FONT face=""
size=2>SSPROP_INIT_AUTOTRANSLATE</FONT>
</P><P align=center><FONT face=""
size=2></FONT></STRONG>Connection
related. Should be specified before connection is
made.
</P></td>
<TD>
<P>
This option configures OEM/ANSI character translation. See
SQLOLEDB documentation for more information.
<BR>
<BR><EM>Valid values</EM>: "VARIANT_TRUE",
"VARIANT_FALSE".
<BR><EM>Default value</EM>:
see SQLOLEDB documentation.</P>
</TD></tr>
<TR>
<TD> <STRONG><P align=center><FONT face=""
size=3>SSPROP_INIT_APPNAME</FONT>
</P></STRONG><P align=center><FONT face=""
size=3>Connection related. Should
be specified before connection is made. <STRONG></STRONG> </FONT>
</P></TD>
<TD>
<P>
Specifies the client application name. See
SQLOLEDB documentation for more information.
<BR>
<BR><EM>Valid values</EM>:
client application name string.
<BR><EM>Default value :</EM>none.</P>
</TD></TR>
<TR>
<TD> <STRONG><P align=center><FONT face=""
size=3>CoInitializeEx_COINIT</FONT>
</P></STRONG><P align=center><FONT face=""
size=3>Connection related. Should
be specified before connection is made. <STRONG></STRONG> </FONT>
</P></TD>
<TD>
<P>
Specifies the
COM library initialization mode. See
SQLOLEDB documentation for more information.
<BR>
<BR><EM>Valid values</EM>: "COINIT_MULTITHREADED",
"COINIT_APARTMENTTHREADED", "Skip"
(SQLAPI++ doesn't initialize COM), "Default"
(SQLAPI++ tries to set "COINIT_MULTITHREADED"
value; if it fails, SQLAPI++
tries to set
"COINIT_APARTMENTTHREADED").
<BR><EM>Default value</EM>: "Default".</P>
</TD></TR>
<TR>
<TD> <STRONG><P align=center>
<STRONG>PreFetchRows</STRONG></P></STRONG><P align=center>Command related.
Should be specified before command execution.</P></TD>
<TD>
<P>
Forces SQLAPI++ Library to fetch
rows in bulk, rather than
retrieving records one by one.
<BR>
</P>
<P><EM>Valid values</EM>: String containing number of rows
in the fetch
buffer.
<BR><EM>Default value</EM>: "1".</P>
</TD></TR>
<TR>
<TD> <STRONG><P align=center>
<STRONG>ICommandPrepare</STRONG></P></STRONG><P align=center>Command related.
Should be specified before command preparation (either
explicit or implicit).</P></TD>
<TD>
<P>
Controls
current command preparation with ICommandPrepare interface.
<BR>
</P>
<P><EM>Valid values</EM>
: "skip"
(skips ICommandPrepare->Prepare() call),
"required" (calls
ICommandPrepare->Prepare() and reports
errors
if any), "optional" (calls ICommandPrepare->Prepare() and
ignores errors if
any).
<BR><EM>Default value</EM>
:
"optional", SQLAPI++ calls
ICommandPrepare->Prepare() for the command, but
doesn't
check for errors.</P>
</TD></TR>
<TR>
<TD> <STRONG><P align=center><FONT face=""
size=2><FONT face=""
size=3>DBPROP_SERVERCURSOR</FONT></FONT>
</P><P align=center><FONT face=""
size=2></FONT>
</P><FONT face="" size=2><P><FONT face=""
size=2>DBPROP_OTHERINSERT</FONT>
</P><P><FONT face=""
size=2>DBPROP_OTHERUPDATEDELETE</FONT>
</P><P><FONT face=""
size=2>DBPROP_OWNINSERT</FONT>
</P><P><FONT face=""
size=2>DBPROP_OWNUPDATEDELETE</FONT>
</P><P>
</P></STRONG><P align=center><FONT face=""
size=3>Command related. Should be specified before
command execution.</FONT> <STRONG></STRONG>
</P></FONT></TD>
<TD>
<P>
Forces SQL Server to
return result sets using one of
the following methods:</P>
<UL>
<LI>Default result sets, which:<BR>- provide maximal
performance in fetching data;<BR>- support only one active statement at a time
on a connection.
<LI>Server cursors, which:<BR>- support multiple
active statements on a single connection;<BR>- can
decrease performance relative to a default result
set.</LI></UL>
<P>
You can request different cursor
behaviors in a rowset by setting rowset <FONT face=""
size=3>properties <FONT face="" size=2><FONT face=""
size=3>DBPROP_SERVERCURSOR,
</FONT></FONT>DBPROP_OTHERINSERT,
DBPROP_OTHERUPDATEDELETE, DBPROP_OWNINSERT,
DBPROP_OWNUPDATEDELETE.</FONT> Some properties can be
safely
combined
with others. See SQLOLEDB documentation
to get more about how
they affect SQL Server cursors.
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -