📄 adoutils.h
字号:
// ADOUTILS: Header File for helper functions for manipulating ADO within
// Visual C++ via MFC OLE
#ifndef _ADOUTILS_H_
#define _ADOUTILS_H_
// Forward Declarations
enum PropertyAttributesEnum;
enum DataTypeEnum;
enum ParameterDirectionEnum;
enum CommandTypeEnum;
// Include ADO Interface/Class Descriptions (ADO 1.0 Version)
// #include "msado10.h"
// Include ADO Interface/Class Descriptions (ADO 1.5 Version)
#include "msado15.h"
// Need two distinct "empty" VARIANTs and BSTR for various Methods
extern VARIANT vtEmpty;
extern VARIANT vtEmpty2;
extern CString strEmpty;
extern BSTR bstrLicKey;
// Connection and SQL Strings
extern CString strAccessConnect;
extern CString strOpenAccess;
extern CString strOpenAccessWithParam;
extern CString strSQLCreate;
extern CString strSQLDrop;
extern CString strStoredProc;
// (shared) utility functions
extern void DumpProperty ( CHorzListBox &List1, _Connection Conn1, Properties &Props1 );
extern CString GetPropertyAttributes( PropertyAttributesEnum e );
extern CString GetType ( int e );
extern CString CrackStrVariant ( const COleVariant& var );
// Event Handlers
extern void OpenAccessDatabase ( CHorzListBox &List1 );
extern void ProviderProperties ( CHorzListBox &List1 );
extern void CodeTemplate ( CHorzListBox &List1 );
extern void InputOutputReturnParams( CHorzListBox &List1 );
// Error/Exception Handlers
extern HRESULT AdoErrorEx ( CHorzListBox &List1, _Connection Conn1 );
extern void MfcErrorEx ( CException *e, CHorzListBox &List1, _Connection Conn1 );
extern void Win32ErrorEx ( SEH_Exception &e, CHorzListBox &List1, _Connection Conn1 );
extern void UnknownErrorEx( CHorzListBox &List1, _Connection Conn1 );
// Taken from adoint.h
enum PropertyAttributesEnum
{
adPropNotSupported = 0,
adPropRequired = 0x1,
adPropOptional = 0x2,
adPropRead = 0x200,
adPropWrite = 0x400
};
// Taken from adoint.h
enum DataTypeEnum
{ adEmpty = 0,
adTinyInt = 16,
adSmallInt = 2,
adInteger = 3,
adBigInt = 20,
adUnsignedTinyInt = 17,
adUnsignedSmallInt = 18,
adUnsignedInt = 19,
adUnsignedBigInt = 21,
adSingle = 4,
adDouble = 5,
adCurrency = 6,
adDecimal = 14,
adNumeric = 131,
adBoolean = 11,
adError = 10,
adUserDefined = 132,
adVariant = 12,
adIDispatch = 9,
adIUnknown = 13,
adGUID = 72,
adDate = 7,
adDBDate = 133,
adDBTime = 134,
adDBTimeStamp = 135,
adBSTR = 8,
adChar = 129,
adVarChar = 200,
adLongVarChar = 201,
adWChar = 130,
adVarWChar = 202,
adLongVarWChar = 203,
adBinary = 128,
adVarBinary = 204,
adLongVarBinary = 205
};
// Taken from adoint.h
enum ParameterDirectionEnum
{ adParamUnknown = 0,
adParamInput = 0x1,
adParamOutput = 0x2,
adParamInputOutput = 0x3,
adParamReturnValue = 0x4
};
// Taken from adoint.h
enum CommandTypeEnum
{ adCmdUnspecified = -1,
adCmdUnknown = 0x8,
adCmdText = 0x1,
adCmdTable = 0x2,
adCmdStoredProc = 0x4
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -