📄 q&a.html
字号:
<html><head><meta name="KEYWORDS" content=" library, C++, Oracle, SQLServer, DB2, Sybase, Informix, InterBase, SQLBase, ODBC,
SQL, server, client, database, programming, development, software,
Win32, Windows, Linux, Unix, Solaris,
Microsoft, Borland, Centura, Gupta, IBM"><meta name="DESCRIPTION" content=
"SQLAPI++ is C++ library for accessing SQL databases (Oracle, SQLServer, Sybase, DB2, InterBase, SQLBase, Informix, ODBC).
It uses native APIs, provides low-level access to database-specific features."><title>SQLAPI++ Library - Q&A</title></head><body bgcolor="#ffffff" BACKGROUND="../images/bg.gif" text="#000000"><!--class="GlbHdr"-->
<table WIDTH=600 height=40
frame=hsides BORDER="2" BORDERCOLOR="#004fcd" align="right" cellpadding="0" cellspacing="2" id="TABLE1">
<tr><!--class="GlbDefault"-->
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../index.html" style="TEXT-DECORATION: none" >
<font color=white size=3 face=sans-serif>
<b>Home</b></font></A></td></TD>
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../HowTo/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>How To</b></font></A></td><!--class="GlbDefault"-->
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../OnLineDoc/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Online Documentation</b></font></A></td><!--class="GlbActive"-->
<td width=70 bgcolor=#00bb00 bordercolor=black align=middle>
<A href="index.html" style="TEXT-DECORATION: none" >
<font color=white size=3 face=sans-serif>
<b>Support</b></font></A></td>
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../Download/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Download</b></font></A></td>
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../Order/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Order</b></font></A></td>
</tr>
</table>
<p> </p>
<p> </p>
<table width="100%">
<tr>
<td valign=top width=165><!--class="LeftMenu"-->
<table frame=void CELLSPACING=5 width=165>
<tr>
<td><p><br></p></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td><!--empty column-->
<td width=20>
<p> </p>
</td><!--Content-->
<td valign=top align=left>
<CENTER>
<h1> SQLAPI++ Q&A</h1></CENTER>
<P>1. <A href="#QandA1">When linking a programm that uses SQLAPI++ I got an
error: <STRONG>unresolved external symbol "__declspec(dllimport)
public: virtual __thiscall ..."</STRONG>.
What is missing?</A>
</P>
<P>2. <A href="#QandA2">When linking a
programm that uses <STRONG>static version of SQLAPI++
Library</STRONG> I got an
error: <STRONG>unresolved external symbol "__declspec(dllimport)
public: virtual __thiscall ..."</STRONG>. What is wrong?
When linking with dynamic version of SQLAPI++
everything is OK.</A>
</P>
<P>3. <A href="#QandA3">How can I get status return code
from stored procedure on Sybase?</A>
</P>
<P>4. <A href="#QandA4">I'm working with Sybase ASE. I have a stored procedure
that has an input-output parameter. But when I
call SAParam::ParamDirType method for this parameter it returns SA_ParamInput,
and when I try to get the parameter's value after the command execution
I receive nothing. What is wrong?</A>
</P>
<HR>
<H3 align=left><A name=QandA1></A>1. When linking a programm that uses SQLAPI++
I got an error: unresolved external symbol "__declspec(dllimport)
public: virtual __thiscall ...". What is
missing?</H3>
<P align=left>Probably you forgot to include sqlapi.lib<SUP>*</SUP> (or
other SQLAPI++ library, depends on the compiler and/or static/dynamic version)
into the project. To link with SQLAPI++ Library you have to
include sqlapi.lib into you project (as well as *.cpp).<BR>For example, in Visual
C++ you have to do the following:</P>
<OL>
<LI>
<DIV align=left>In workspace tree select the project that you link with
SQLAPI++.</DIV>
<LI>
<DIV align=left>Use "Add Files to Project..." command on the right click
menu and add sqlapi.lib to you project.</DIV>
<LI>
<DIV align=left>Press F7 button to compile and link you
project.</DIV></LI></OL>
<P align=left>* sqlapi.lib should be used when linking with dynamic version
of SQLAPI++ using Microsoft Visual C++.<BR>To link with a
static version using MSVC++ use sqlapis.lib.<BR>To link with a dynamic version
using Borland C++ compiler use sqlapib.lib.<BR>To link with a static version
using Borland C++ compiler use sqlapibs.lib.<BR>To link with a dynamic version using
Borland C++ Builder compiler use sqlapibb.lib.<BR>To link with a static version using
Borland C++ Builder compiler use sqlapibbs.lib.<BR>To link with a debug
version use appropriate lib file that ends with 'd'.</P>
<H3 align=left><A name=QandA2></A>2. When linking a
programm that uses static version of SQLAPI++
Library I got an
error: <STRONG>unresolved external symbol "__declspec(dllimport)
public: virtual __thiscall ..."</STRONG>. What is wrong?
When linking with dynamic version of SQLAPI++
everything is OK.</H3>
<P align=left>
To link with static library
of SQLAPI++ you have to define SQLAPI_STATIC preprocessor definition.<BR>For example, in Visual
C++ you have to do the following:</P>
<OL>
<LI>
<DIV align=left>In workspace tree select the project that you link with static
SQLAPI++.</DIV>
<LI>
<DIV align=left>Use "Project /
Settings" command in menu and add string
<STRONG>SQLAPI_STATIC</STRONG>
into "C/C++ - Preprocessor definition" field.</DIV>
<LI>
<DIV align=left>Press F7 button to compile and link you
project.</DIV></LI></OL>
<H3 align=left><A name=QandA3></A>3. How can I get status return code from stored procedure
on Sybase (or SQL Server)?</H3>
<P align=left>
SQLAPI++
Library automatically creates <STRONG>SAParam object</STRONG> to
represent procedure status return code. After a command execution
you can check it value. This SAParam object's name
is <STRONG>"RETURN_VALUE"</STRONG>, object's type is
<STRONG>SA_dtLong</STRONG>
, object's direction type is <STRONG>SA_ParamReturn</STRONG>.
</P>
<H3 align=left><A name=QandA4></A>4. I'm working with Sybase ASE.
I have a stored procedure
that has an input-output parameter. But when I
call SAParam::ParamDirType method for this parameter it returns SA_ParamInput,
and when I try to get the parameter's value after the command execution
I receive nothing. What is wrong?</H3>
<p><STRONG>Sybase
ASE</STRONG> server does not provide information about parameter's
direction type, that's why SQLAPI++ Library defines all parameters
(except status result code) as input (SA_ParamInput). If you have
input-output parameters in the procedure you have to call <STRONG
>SAParam::setParamDirType</STRONG> method for
these parameters before command execution and set parameter's
direction type explicitly (SA_ParamInputOutput).<BR>You shouldn't call this method for procedure status result
code because it is detected correctly (as SA_ParamReturn) by the
Library.</p>
<p>There is no need to call this method for
<STRONG>Sybase ASA</STRONG> because all
parameters are detected correctly automatically (including the
direction type).</p>
<P align=left>
</P>
</td>
<tr></tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -