asyncdatabase.h

来自「完成在ODBC中进行异步调用的C程序源代码」· C头文件 代码 · 共 55 行

H
55
字号
// AsyncDatabase.h : header file
//
//***************************************************************************
// Asynchronous database
// performs asynchronous query execution 
// 
// SAMPLE:
// CAsyncDatabase * pDB = new CAsyncDatabase;
// pDB->OpenEx(....);
// HSTMT hstmt = pDB->ExecuteSQLAsync("SELECT * FROM SOMEWHERE");
// while(pDB->SQLStillExecuting(hstmt))
// {
//		... do something here ...
// }
// 
// do not call SQLFreeStmt() if you are using SQLStillExecuting() loop
// 
// WARNING: according to MSDN documentation asynchronous execution must be 
// done in working threads only!
// fortunately MS SQL Server works around this problem
//***************************************************************************

#ifndef _ASYNC_DATABASE_H_
#define _ASYNC_DATABASE_H_

class CAsyncDatabase : public CDatabase
{
// Construction
public:
	CAsyncDatabase();

// Attributes
public:

// Operations
public:

// Implementation
public:
	virtual ~CAsyncDatabase();
	
	HSTMT ExecuteSQLAsync(LPCTSTR lpszSQL);

	BOOL SQLStillExecuting(HSTMT hstmt);

	virtual void OnSetOptions(HSTMT hstmt);
	virtual void Cancel(HSTMT hstmt);

	// Generated message map functions
protected:
	CMapStringToString m_mapHstmtToQuery;
};

/////////////////////////////////////////////////////////////////////////////
#endif // _ASYNC_DATABASE_H_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?