在ADO中RecordSet Open 以后,在Open就出错,怎样判断ADO中RecordSet 的被Open
解决方案 »
- VC写的OCX,用C#调用问题
- 怎么?文件指针地址给BYTE[]
- VC里建立的VPN连接,我怎么去掉数据加密那个选项啊,因为我的服务器是不支持加密数据的
- 如何通过点击listctrl中得一行之后获得显示相应得图片 !之后显示??
- 如何用鼠标左键画线并在上面取点拖动修改.
- 请问哪里可以下载vc6.0
- 自定义的ID,使用哪个范围的不会冲突重复呢?
- 用vc++开发一个类似qq的即时通讯软件需要多少时间?
- 请问如何将一个CString转换为char类型?
- 在程序执行到Sleep函数时,cpu是否可以被其它程序使用。
- 是不是感染了病毒?是什么病毒?先谢过大家了。
- 请问如何才能通过程序在DNS服务器中添加新记录?各位有没有好办法?
recordset.close
判断RecordSet是否打开
if(recordset.IsOpen())
recordset->close();
解决的方法就是在你所有要对表或数据库操作的函数的开始出都要判断一下
数据库或表是否已经打开
//监测dao数据库对象的有效性,并在纪录集对象打开时关闭该记录集
if(!m_pDatabase->IsOpen())
return;
if(!m_pRecordset)
return;
if(m_pRecordset->IsOpen())
m_pRecordset->Close();
Indicates for all applicable objects whether the state of the object is open or closed.ObjectStateEnum
Specifies whether an object is open or closed, connecting to a data source, executing a command, or retrieving data.Constant Value Description
adStateClosed 0 Indicates that the object is closed.
adStateOpen 1 Indicates that the object is open.
adStateConnecting 2 Indicates that the object is connecting.
adStateExecuting 4 Indicates that the object is executing a command.
adStateFetching 8 Indicates that the rows of the object are being retrieved.