设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> Visual C++ >> AppBuilder中进行直接ODBC API数据库调用访问的基本方法!
精品推荐
Visual C++点击TOP10
·用WINSOCK实现聊天室的VC++程序设计
·利用mfc编写activex控件
·用vc实现生产者消费者问题
·DirectX8.0
·C/C++ 大量经典编程书籍下载
·VC快捷键大全
·CreateFileMapping的MSDN翻译和使用心得
·Windows环境下的麦克风录音系统
·挂钩Windows API
·如何开发OPC Server
编程开发点击TOP10
·数字小键盘指法练习
·用C语言编通讯录程序(初学者级别的)
·ASP.NET 程序中常用的三十三种代码
·我写的Java学生成绩管理系统源代码
·CHK文件恢复工具
·Modem 常用AT指令集
·java笔试题
·异常java.sql.SQLException: Io exception:The Network Adapter could not establish connection
·单片机模拟I2C总线及24C02(I2C EEPROM)读写实例(源代码)
·C++经典电子书下载
精选专题

AppBuilder中进行直接ODBC API数据库调用访问的基本方法!

作者: 来源:网络文章 时间:2005-12-13 18:42:44

AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(11) CDData_aBeiZhu_SIZE,0, HostData.m_Abeizhu, 0,&HostData.m_AbeizhuInd );

}

// Move the data to host structure and execute the statement
HostData.m_Nguangpan = pData->m_Nguangpan;
HostData.m_Nwenjian = pData->m_Nwenjian;
HostData.m_Nclass = pData->m_Nclass;
HostData.m_AwenjianInd = SQL_NTS;
memcpy(HostData.m_Awenjian, pData->m_Awenjian, CDData_aWenJian_SIZE);
HostData.m_Nshangji = pData->m_Nshangji;
HostData.m_Nshuxing = pData->m_Nshuxing;
HostData.m_AbeizhuInd = SQL_NTS;
memcpy(HostData.m_Abeizhu, pData->m_Abeizhu, CDData_aBeiZhu_SIZE);

ReturnCode = SQLExecute(m_hstmt);
if (ReturnCode != SQL_SUCCESS)
{
return false;
}

return true;

}


九、其他操作:

1、检测SQL错误:
void DisplayError(SQLRETURN nResult, SWORD fHandleType, SQLHANDLE handle)
{
UCHAR szErrState[SQL_SQLSTATE_SIZE+1]; // SQL Error State string
UCHAR szErrText[SQL_MAX_MESSAGE_LENGTH+1]; // SQL Error Text string
char szBuffer[1000];
char szDispBuffer[1000]; // Display Buffer
// formatted Error text Buffer
SWORD wErrMsgLen; // Error message length
long dwErrCode; // Native Error code
int iSize; // Display Error Text size
SQLRETURN nErrResult; // Return Code from SQLGetDiagRec
SWORD sMsgNum = 1;
SWORD fFirstRun = TRUE;

szBuffer[0] = '\0';

do
{
// continue to bring messageboxes till all errors are displayed.
// more than one message box may be reqd. as err text has fixed
// string size.

// initialize display buffer with the string in error text buffer
strcpy(szDispBuffer, szBuffer);

// call SQLGetDiagRec function with proper ODBC handles, repeatedly until
// function returns SQL_NO_DATA. Concatenate all error strings
// in the display buffer and display all results.
while ((nErrResult = SQLGetDiagRec(fHandleType, handle, sMsgNum++,
szErrState, &dwErrCode, szErrText,
SQL_MAX_MESSAGE_LENGTH-1, &wErrMsgLen))
!= SQL_NO_DATA) {

1.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(1)
2.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(2)
3.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(3)
4.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(4)
5.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(5)
6.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(6)
7.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(7)
8.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(8)
9.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(9)
10.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(10)
11.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(11)
12.AppBuilder中进行直接ODBC API数据库调用访问的基本方法!(12)
共12页 9 7 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [128 :>

AppBuilder中进行直接ODBC API数据库调用访问的基本方法! 相关文章:
AppBuilder中进行直接ODBC API数据库调用访问的基本方法! 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com