www.pudn.com > OutputoracleDBStruct2XML.rar > ADOHelpmate.h


#pragma  once 
 
////////////////////////////////////ADOHelper////////////////////////////////////// 
namespace ADOHelper 
{ 
	//是否为有效的_RecordsetPtr类型 
	inline bool RstEmpty(const ADODB::_RecordsetPtr & pRst) 
	{ 
		return (pRst==NULL && pRst->adoEOF ==VARIANT_TRUE);	 
	} 
 
	ADODB::_ConnectionPtr	GetConnectionFromRecordset(ADODB::_RecordsetPtr & pRst); 
 
	BOOL ShellExecuteSql(const ADODB::_ConnectionPtr &pConn,LPCTSTR sqlCmd);	//执行不带返回值的SQL命令 
	BOOL ShellExecuteSql(const ADODB::_ConnectionPtr &pConn,CString sqlCmd);	//执行不带返回值的SQL命令 
 
	BOOL ShellExecuteSqlEx(const ADODB::_ConnectionPtr &pConn,CString sqlCmd,ADODB::_RecordsetPtr  &pRst); //执行带返回值的SQL命令 
	BOOL ShellExecuteSqlEx(const ADODB::_ConnectionPtr &pConn,LPCTSTR sqlCmd,ADODB::_RecordsetPtr  &pRst); //执行带返回值的SQL命令 
 
 
	_bstr_t GetAdoStrValue(ADODB::_RecordsetPtr  &pRst,LPCTSTR fieldname);		//获取字符型字段值(参数检查由外部负责) 
 
	long	GetAdoLongValue(ADODB::_RecordsetPtr  &pRst,LPCTSTR fieldname);		//获取整型字段值(参数检查由外部负责) 
 
	double  GetAdoDoubleValue(ADODB::_RecordsetPtr  &pRst,LPCTSTR fieldname);	//获取double型字段值(参数检查由外部负责) 
 
	//#ifdef __ATLCOMTIME_H__ 
	_bstr_t GetAdoDateValue(ADODB::_RecordsetPtr  &pRst,LPCTSTR fieldname,UINT nFormatID = 0/*0=>2008-1-1 1=>2008年1月1日*/ ); 
	//#endif 
}