- CStringcsSql3=_T("SELECT*FROMUserTbWHEREuid=123456;");
- wicDB.ExecuteSQL(csSql3);
- if(wicDB.OpenRecordset(csSql3,1))
- {
- CStringstrPar=_T("privilege");
- result3=wicDB.GetCollect(strPar);
- MessageBox(NULL,result3.bstrVal,_T("PASS"),MB_OK);
- }
- csSql=_T("SELECT*FROMUserTbWHEREuid='1234';");
- if(wicDB.ExecuteSQL(csSql))
- {
- MessageBox(NULL,csSql,_T("PASS"),MB_OK);
- }
- csSql=_T("SELECT*FROMUserTbWHEREuid='123';");
- if(wicDB.ExecuteSQL(csSql))
- {
- MessageBox(NULL,csSql,_T("PASS"),MB_OK);
- }
- else
- {
- MessageBox(NULL,csSql,_T("FAIL"),MB_OK);
- }
- csSql=_T("SELECT*FROMUserTbWHEREuid='123456';");
- if(wicDB.ExecuteSQL(csSql))
- {
- MessageBox(NULL,csSql,_T("PASS"),MB_OK);
- }
- 以下的代码是完全OK的~
-
- CDBManagewicDB;
- wicDB.OpenDB();//连接数据库
- //打开记录集
- CStringSqlStr=_T("SELECT*FROMUserTbWHEREuid='123456'");
- if(wicDB.OpenRecordset(SqlStr,1))
- {
- MessageBox(NULL,_T("OpenOK"),_T("OpenRecordset"),MB_OK);
- }
- else
- {
- MessageBox(NULL,_T("OpenFail"),_T("OpenRecordset"),MB_OK);
- }
- VARIANTvPwd;
- VariantInit(&vPwd);
- CStringstrParam=_T("privilege");
- vPwd=wicDB.GetCollect(strParam);
- MessageBox(NULL,vPwd.bstrVal,_T("OpenRecordset"),MB_OK);
- wicDB.CloseDB();
- returnTRUE;
- CStringtest1=_T("TestUPC1"),test2=_T("1234567");
- wicDB.SetItemPrice(test1,test2);
- 测试SetItemPrice函数
- LastTransaction*ltExample;
- if(wicDB.GetLastTransData(ltExample))
- {
- ;
- }
- LastTransactionltExample={"004","4","40","123","08102","11111","08102011111"};
- //在初始化的时候注意字符初始化的时候大小问题
- if(wicDB.SetLastTransData(ltExample))
- {
- ;
- }