本文整理汇总了C++中CConnect::getVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ CConnect::getVersion方法的具体用法?C++ CConnect::getVersion怎么用?C++ CConnect::getVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConnect
的用法示例。
在下文中一共展示了CConnect::getVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GETOBJREF
//.........这里部分代码省略.........
exception_.u.ASNotAvailable.ErrorText);
break;
case odbcas_ASSvc_GetObjRefHdl_LogonUserFailure_exn_ :
PVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
exception_.u.LogonUserFailure.errorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL);
pConnection->setDiagRec(ASSOC_SERVER_ERROR, IDS_UNABLE_TO_LOGON,
exception_.u.LogonUserFailure.errorCode,
(char *)lpMsgBuf);
LocalFree(lpMsgBuf);
break;
case odbcas_ASSvc_GetObjRefHdl_ASNotAvailable_exn_ :
pConnection->setDiagRec(ASSOC_SERVER_ERROR,IDS_ASSOC_SRVR_NOT_AVAILABLE, 0,
exception_.u.ASNotAvailable.ErrorText);
break;
case odbcas_ASSvc_GetObjRefHdl_DSNotAvailable_exn_:
pConnection->setDiagRec(ASSOC_SERVER_ERROR,IDS_DS_NOT_AVAILABLE,0L,
exception_.u.DSNotAvailable.ErrorText);
break;
case odbcas_ASSvc_GetObjRefHdl_PortNotAvailable_exn_:
pConnection->setDiagRec(ASSOC_SERVER_ERROR, IDS_PORT_NOT_AVAILABLE);
break;
case odbcas_ASSvc_GetObjRefHdl_InvalidUser_exn_:
pConnection->setDiagRec(ASSOC_SERVER_ERROR, IDS_28_000);
break;
case odbcas_ASSvc_GetObjRefHdl_ASTimeout_exn_ :
pConnection->setDiagRec(ASSOC_SERVER_ERROR, IDS_S1_T00);
break;
case odbcas_ASSvc_GetObjRefHdl_ASNoSrvrHdl_exn_ :
pConnection->setDiagRec(ASSOC_SERVER_ERROR,IDS_NO_SRVR_AVAILABLE, 0,
exception_.u.ASNotAvailable.ErrorText);
break;
case odbcas_ASSvc_GetObjRefHdl_ASTryAgain_exn_ :
case -27:
break;
case -29:
break;
default:
pConnection->setDiagRec(exception_.exception_nr, GET_OBJECT_REF_PROCNAME,
pConnection->getSrvrIdentity());
break;
} /* Ends CCF */
switch (pConnection->getExceptionNr())
{
case CEE_SUCCESS:
pConnection->getVersion(&version, NSK_ODBCAS_COMPONENT);
if (version.componentId != NSK_ODBCAS_COMPONENT ||
version.majorVersion != NSK_VERSION_MAJOR_1 ||
version.minorVersion != NSK_VERSION_MINOR_0 )
{
char tmp[100];
IDL_short majorVersion = version.majorVersion;
IDL_short minorVersion = version.minorVersion;
majorVersion = (majorVersion > 0)? majorVersion - 1: majorVersion;
sprintf(tmp,"Incorrect AS version: %d.%d, expected: %d.%d",majorVersion,minorVersion,NSK_VERSION_MAJOR_1 - 1,NSK_VERSION_MINOR_0);
pConnection->setDiagRec(ASSOC_SERVER_ERROR, IDS_S1_000, 0, tmp,NULL, 0, 0, 1, tmp);
rc = SQL_ERROR;
}
break;
case odbcas_ASSvc_GetObjRefHdl_ASTryAgain_exn_:
_ftime(&time_curr);
curTimeout = (long)(time_curr.time - time_start.time);
if ((dwTimeout != 0) && (dwTimeout <= curTimeout))
{
pConnection->setDiagRec(ASSOC_SERVER_ERROR, IDS_S1_T00);
rc = SQL_ERROR;
break;
}
else
{
if(dwTimeout != 0)
srvrCallContext->u.connectParams.loginTimeout = dwTimeout - curTimeout;
Sleep(dwSleep);
getObjRefRetryCnt++;
goto TryAgain;
}
break;
default:
rc = SQL_ERROR;
break;
}
/*
* CleanUp
*/
if(versionList._buffer != NULL)
delete versionList._buffer;
return rc;
}