⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqlcesvr.h

📁 对ce sqlsvr的一系列操作
💻 H
字号:

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the SQLCESVR_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// SQLCESVR_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef SQLCESVR_EXPORTS
#define SQLCESVR_API __declspec(dllexport)
#else
#define SQLCESVR_API __declspec(dllimport)
#endif

// This class is exported from the SqlceSvr.dll
class SQLCESVR_API CSqlceSvr {
public:
	CSqlceSvr(void);
	// TODO: add your methods here.
};

extern SQLCESVR_API int nSqlceSvr;

SQLCESVR_API int fnSqlceSvr(void);

#define OLEDBVER 0x210	
#define DBINITCONSTANTS 
#define INITGUID        

#include <windows.h>
#include <urlmon.h>
#include <oledb.h>
#include <oledberr.h>
#include "ssceoledb.h"
#include <coguid.h>
#include <Oaidl.h>			
#include <commctrl.h>


// Provider Interfaces
IDBInitialize		*pIDBInitialize		 = NULL;
IUnknown			*pIUnknownSession	 = NULL;
IDBCreateSession	*pIDBCreateSession	 = NULL;
IDBProperties		*pIDBProperties		 = NULL;
IDBCreateCommand	*pIDBCrtCmd			 = NULL;
ICommandText		*pICmdText			 = NULL;

//extern  "C" SQLCESVR_API int testdll(int a,int b);
extern  "C" SQLCESVR_API HRESULT Init(void);
extern  "C" SQLCESVR_API void UnInit(void);

// Create a new SQL Server CE database provider.
extern "C" SQLCESVR_API HRESULT	CreateSqlSvrCeProvider(void);

// Create a new SQL Server CE database session right
// after successful connect to the pass in database
// name (*.sdf) in fullpath.
extern  "C" SQLCESVR_API HRESULT CreateDBSession (void);

// Retrieve the last known OLE DB error message, due to
// error occur through out the database access process.
extern  "C" SQLCESVR_API HRESULT GetErrorMessage(LPTSTR lpszBuffer, int MaxBuffer);

// Connect the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
extern  "C" SQLCESVR_API HRESULT ConnectDB(LPTSTR lpszDBName);

// Disconnect from the current open SQL Server CE database
// with reference to the pass in database name (*.sdf) in
// fullpath under the CreateDB/ConnectDB function.
extern  "C" SQLCESVR_API HRESULT DisconnectDB(LPTSTR lpszDBName);

// Create the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
extern  "C" SQLCESVR_API HRESULT CreateDB(LPTSTR lpszDBName);

// Delete the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
extern  "C" SQLCESVR_API HRESULT DeleteDB(LPTSTR lpszDBName);

// Compact the SQL Server CE database with reference to
// the pass in database name (*.sdf) in fullpath.
extern  "C" SQLCESVR_API HRESULT CompactDB(LPTSTR lpszDBName);

// Execute the SQL Statement with does not require to
// return a RowSet object.
// EXAMPLE:
// SELECT, DELETE, CREATE TABLE, DROP TABLE, INSERT INTO & etc...
extern  "C" SQLCESVR_API HRESULT ExecuteSQL(LPTSTR lpszQuery);

// Load the records into a RowSet object with reference
// to the pass in SQL statement.
extern  "C" SQLCESVR_API HRESULT GetRowset(LPTSTR lpszQuery,HWND hWndList1);
extern  "C" SQLCESVR_API HRESULT GetRowsetEx(LPTSTR lpszQuery,HWND hWndList1,int iskip);
// Process the Rowset object created by the GetRowset function.
extern  "C" SQLCESVR_API HRESULT ProcessRowset(IRowset *pRowset,HWND hWndList1);
extern  "C" SQLCESVR_API HRESULT ProcessRowsetEx(IRowset *pRowset,HWND hWndList1,int iskip);

⌨️ 快捷键说明

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