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

📄 madopacket.h

📁 目前只做了基于SQL Server的ADO封装
💻 H
字号:
/*

 **********************************************************************************
 *                                                                                *
 * Copyright (c) 2008, RedRabbitHorse                                             *
 * All rights reserved                                                            *
 *                                                                                *
 * Filename: AdoPacket.h                                                            *
 * Filelabel: _MSW_ADOPACKET_H                                                      *
 * Description:	Declaration all funtion of ADO as a class.                        *
 *                                                                                *
 * Current Version: 0.9                                                           *
 * Author: Ma Shiwen                                                              *
 * End date: 02-06-2008                                                           *
 *                                                                                *
 * Instead for:                                                                   *
 * Original Author: Ma Shiwen                                                     *
 * End date: 02-06-2007                                                           *
 *                                                                                *
 **********************************************************************************

*/

#ifndef _MSW_ADOPACKET_H
#define _MSW_ADOPACKET_H

#define M_REC_START		1
#define M_REC_END		2
#define M_REC_CURRENT	3


#include "stdafx.h"
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "adoEOF") rename("BOF", "adoBOF")

class mswADO
{
	public:
		CString GetFieldName(long index);
		_variant_t GetValue(long index);
		bool IsBOF();
		bool IsEOF();
		bool Last();
		bool First();
		bool Previous();
		bool Next();
		bool OpenTable(CString &cmd, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType);
		void RefreshRec();
		void CloseTable();
		bool Move(long num);
		long GetFieldCount();
		long m_lFieldCount;
		bool Move(long num, int start);
		long GetCount(void);
		bool IsEmpty();
		bool Connect(CString &ser, CString &db);
		bool OpenTable(CString &table);
		bool OpenTable(char *table);
		bool Connect(char *ser, char *db);
		void SetField(char *field);
		void SetTable(char *table);
		void SetPW(char *pw);
		void SetUser(char *user);
		void SetDatabase(char *db);
		void SetServer(char *ser);
		bool SetValue(char *field, int buf);
		bool SetValue(char *field, float buf);
		bool SetValue(char *field, double buf);
		bool SetValue(char *field, CString &buf);
		int GetValue(char *field, int &buf);
		float GetValue(char *field, float &buf);
		double GetValue(char *field, double &buf);
		CString GetValue(char *field, CString &buf);
		bool SetValue(CString &field, int buf);
		bool SetValue(CString &field, float buf);
		bool SetValue(CString &field, double buf);
		bool SetValue(CString &field, CString &buf);
		int GetValue(CString &field, int &buf);
		float GetValue(CString &field, float &buf);
		double GetValue(CString &field, double &buf);

		CString GetValue(CString &field, CString &buf);

		void SetField(CString &field);
		bool SetValue(int buf);
		bool SetValue(float buf);
		bool SetValue(double buf);
		bool SetValue(CString &str);
		long GetValue(long &buf);
		int GetValue(int &buf);
		float GetValue(float &buf);
		double GetValue(double &buf);
		CString GetValue(CString &str);
		bool OpenTable();
		CString GetTable(void);
		void SetTable(CString &table);
		CString GetUser(void);
		CString GetDatabase(void);
		CString GetServer(void);
		void SetUser(CString &user);
		void SetPW(CString &pw);
		void SetDatabase(CString &db);
		void SetServer(CString &ser);
		bool Connect();
		mswADO();
		~mswADO();


	protected:

	private:
		void GetError(_com_error &e);

		long m_lCount;
		void UnInitialize(void);
		CString m_strIndexField;
		CString m_strField;
		CString m_strTable;
		void ExitConnection();
		CString m_strPW;
		CString m_strUser;
		CString m_strServer;
		CString m_strDatabase;
		CString m_strLastError;
		void Initialize();
		_RecordsetPtr m_pRecordset;
		_ConnectionPtr m_pConnection;

};





#endif

⌨️ 快捷键说明

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