MFC使用ADO连接数据库的类
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220 ...
adOpenKeyset、adLockBatchOptimistic说明
vc使用ADO连接数据库 ADODB中的RecordSet.Open打开记录的两个参数adOpenKeyset、adLockBatchOptimistic的说明:
缺省值 1 adLockReadOnly RecordSet对象以只读方式启动,无法运行增、删、改等操作 2 adLockPrssimistic 当数据源正在更新时,系统会锁定其他用户的动作,以保数据一致性。 3 adLockOptimistic 当数据源正在更新时,系统不会锁定其他用户的动作,其他用户可以对数据进行增、删、改操作。 4 adLockBatchOptimistic 当数据源正在更新时,其他用户必须将CursorLocation改为adUdeClientBatch才能对数据进行增、删、改的操作。
默认值 0 adOpenForwardOnly 使用仅向前游标。除了在记录中只能向前滚动外,与静态游标相同。当只需要在 Recordset 中进行一个传递时,用 ...
在DLL中使用ADO连接数据库的问题
1#import "c:/program files/common files/system/ado/msado15.dll" no_namespace rename("EOF","adoEOF")
但是在编译的时候会报如下错误:error C2011: ‘’’’LockTypeEnum’’’’ : ‘’’’enum’’’’ type redefinitionerror C2011: ‘’’’DataTypeEnum’’’’ : ‘’’’enum’’’’ type redefinitionerror C2011: ‘’’’FieldAttributeEnum’’’’ : ‘’’’enum’’’’ type redefinitionerror C2011: ‘’’’EditModeEnum’’’’ : ‘’’’enum’’’’ type redefinitionerror C2011: ‘’’’RecordStatusEnum’’’’ : ‘’’’enum’’’’ type redefinition
在网上查找最终使用如下方法解 ...
boost::spirit验证字符串是否符合四则运算规则
1234567891011121314151617181920212223#include <iostream>#include <boost/spirit.hpp> int main(){ using namespace boost::spirit; using namespace std; rule<phrase_scanner_t> factor, term, exp; // 因子 = 实数 | '(' , 表达式 , ')'; factor = real_p | ('(' >> exp >> ')'); // factor = real_p | !(ch_p('+')|ch_p('-')) >> ('(' >> exp >> ')') // 上面注释部分是括号前可以带正负号 ...
设置List控件样式
12345m_ctrlListGunInfo.SetExtendedStyle(LVS_EX_FLATSB |LVS_EX_FULLROWSELECT |LVS_EX_HEADERDRAGDROP |LVS_EX_ONECLICKACTIVATE |LVS_EX_GRIDLINES);
原型123DWORD SetExtendedStyle( DWORD dwNewStyle );
Parameters参数dwNewStyleA combination of extended styles to be used by the list view control. For a descriptive list of these styles, see the Extended List View Styles topic in the Platform SDK.
结合扩展样式使用的列表视图控件。描述这些风格的列表,在平台SDK参考扩展列表视图风格主题。
Return Value 返回值A combination of the previous extended st ...
_ConnectionPtr、_RecordsetPtr和_CommandPtr 打开和关闭
_ConnectionPtr、_RecordsetPtr和_CommandPtr 打开和关闭12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970_ConnectionPtr:_ConnectionPtr m_pConnection;HRESULT hr;try{hr = m_pConnection.CreateInstance(_uuidof(Connection));///创建Connection实例if(SUCCEEDED(hr)){ m_pConnection->ConnectionTimeout=600;//设置连接超时时间 m_pConnection->CommandTimeout=120;//设置执行命令超时时间hr = m_pConnection->Open("Provider=Microsoft.Jet.OLED ...
boost正则表达式判断字符串是不是正确的四则运算
使用正则表达式判断字符串是否符合四则混合运算规则。
123456789"[^0-9\\.\\+\\-\\*\\/\\(\\)]" // 除了数字小数点和运算符之外的符号"[\\+\\-\\*\\/][)]|[)][0-9.]" // )前面有运算符号+-*/ )后面有数字"[0-9\\.][(]|[(][\\*\\/]" // (前面有数字 (后面有运算符号*/"\\.[0-9]*\\." // 数字小数点超过2个(包括两个)"[\\+\\-\\*\\/]\\.{1,}[\\+\\-\\*\\/]" // 两个运算符号只间只有小数点 "[\\+\\-\\*\\/][\\*\\/]|[\\+\\-\\*\\/][\\+\\-][\\+\\-\\*\\/]" // 三个运算符号连接, 两个*/运算符号连接"^[\\*\\/]|[\\+\\-\\*\\/]$&quo ...
VS2008下安装和使用BOOST库boost-1_54
下载boost库(最好去官网下,一般有SGI(GCC+用的较多)和BOOST之分,VS下用BOOST)下载boost_1_54_0压缩文件,解压缩到d:\boost_1_54_0(可以任何位置,你觉得合适就可以)目录下
1.编译bjam从开始->程序->Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 命令提示(一定要从这进),命令提示cd到
d:\boost_1_54_0\下执行bootstrap.bat,会在d:\boost_1_54_0产生 bjam.exe2.编译boost命令提示cd到d:\boost_1_54_0\下執行bjam —without-python —toolset=msvc-9.0 —prefix=d:\boost install 參數說明 —without-python 表示不使用 python —toolset : 所使用compiler,Visual Studio 2008為msvc-9.0 —prefix:指定编译后library的 ...
四则混合运算
四则混合运算,输入不带空格的字符串。返回结果存放在rValue中
可以使用+-*/和(),正负数前可以带符号
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170struct _data { int dataType; CSt ...
MFC窗口透明
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758// 在OnCreate()或OnInitDialog()加入以下代码 SetWindowLong(this->GetSafeHwnd() , GWL_EXSTYLE, GetWindowLong(this->GetSafeHwnd() , GWL_EXSTYLE)|WS_EX_LAYERED); SetLayeredWindowAttributes(RGB(0, 0, 0), 125, 0x2/*0x1 | 0x2*/); // SetWindowLong是一个Windows API函数。该函数用来改变指定窗口的属性。 LONG SetWindowLong(HWND hWnd, // handle to windowint nlndex, ...