CodePudding user response:
Compiler to generate failure, cleaning project, rebuilding all give it a try,Is insufficient permissions, as an administrator to run VS try
Project copy to the C disk directory try
CodePudding user response:
It is ok to baidu LNK1123,CodePudding user response:
Delete the original Release the compiled file to compileCodePudding user response:
This code in Windows 7 to run normally, can run in win10 to return, the collapse in 1 minutes, seek guidance,Void CLogin: : OnBnClickedButton3 ()//button
{
UpdateData(TRUE);
CADOConn m_ADOConn;
Cstrings strPath=_T (" personnel. MDB ");//file path
M_ADOConn. OnInitADOConn (strPath);//connect to the database
//determine whether ExamArrange table been tampered with
_bstr_t SQL="select * from ExamArrange";
_RecordsetPtr m_pRecordSet=m_ADOConn. GetRecordSet (SQL, strPath);//record set pointer
Int n=m_pRecordSet - & gt; GetRecordCount ();//the number of the recordset
If (n==0)//data in the table is empty
{
MessageBox (_T (" the test information is empty, can't test!" ), _T (" Saes tips "));
M_ADOConn. ExitConnect ();//disconnect database, otherwise continuous run multiple times may be out of memory
return;
}
COleDateTime tm=COleDateTime: : GetCurrentTime ();//get the system time
while(! M_pRecordSet - & gt; AdoEOF)
{
_variant_t var1=m_pRecordSet - & gt; GetCollect (name of "test");//the value of the field
Cstrings str1;
If (var1 vt!=VT_NULL)//list box shows can't be empty, otherwise automatic exit
Var1 str1=(LPCSTR) (_bstr_t);
_variant_t var2=m_pRecordSet - & gt; GetCollect (" start time ");
Cstrings str2;
If (var2 vt!=VT_NULL)
Var2 str2=(LPCSTR) (_bstr_t);
_variant_t var3=m_pRecordSet - & gt; GetCollect (" end time ");
Cstrings str3;
If (var3 vt!=VT_NULL)
Var3 str3=(LPCSTR) (_bstr_t);//end time
_variant_t var4=m_pRecordSet - & gt; GetCollect (" qualified scores ");
Cstrings pass;
If (var4 vt!=VT_NULL)
Pass=(LPCSTR) (_bstr_t) var4;
_variant_t var5=m_pRecordSet - & gt; GetCollect (" prescription ");
Cstrings str5;
If (var5 vt!=VT_NULL)
Var5 str5=(LPCSTR) (_bstr_t);//"end"
_variant_t var6=m_pRecordSet - & gt; GetCollect (" save code ");
Cstrings str6;
If (var6 vt!=VT_NULL)
Str6=(LPCSTR) var6 (_bstr_t);
If (md5 (str1 + str2 + str3 + pass + str5)!=str6)
{
MessageBox (_T (" the test information has been tampered with, to the test!" ), _T (" Saes tips "));
M_ADOConn. ExitConnect ();//disconnect database
return;
}
//whether the test end
COleDateTime EndTime;
EndTime. ParseDateTime (str3);
If (str5==_T (" ") & amp; & EndTime<=tm)
{
Cstrings SSQL cvar;
Cvar=md5 (+ str2 + str3 + pass + str1 _T (" end "));
M_pRecordSet - & gt; PutCollect (" prescription ", _variant_t (_T (" end ")));//write
M_pRecordSet - & gt; PutCollect (" save code ", _variant_t (cvar));//write
M_pRecordSet - & gt; The Update ();//update the records in the table
}
M_pRecordSet - & gt; MoveNext ();//move to the next record
}
//determine whether JoinExam table are deleted row
_bstr_t SQL="select * from ExamRegister";
_RecordsetPtr m_pRecordSet1=m_ADOConn. GetRecordSet (SQL, strPath);
Int m=m_pRecordSet1 - & gt; GetRecordCount ();
_bstr_t asql="select * from JoinExam";
_RecordsetPtr m_pRecordSet2=m_ADOConn. GetRecordSet (asql strPath);
Int a=m_pRecordSet2 - & gt; GetRecordCount ();
If (a==0 | | m==0)
{
MessageBox (_T (" database has been tampered with, to the test!" ), _T (" Saes tips "));
M_ADOConn. ExitConnect ();
return;
}
//determine whether ExamRegister table been tampered with
_bstr_t strSQL="select * from ExamRegister where performance is null".
_RecordsetPtr m_pRecordSet3=m_ADOConn. GetRecordSet (strSQL, strPath);
while(! M_pRecordSet3 - & gt; AdoEOF)
{
_variant_t evar1=m_pRecordSet3 - & gt; GetCollect (" name ");
Cstrings estr1;
If (evar1 vt!=VT_NULL)
Evar1 estr1=(LPCSTR) (_bstr_t);
_variant_t evar2=m_pRecordSet3 - & gt; GetCollect (" department ");
Cstrings estr2;
If (evar2 vt!=VT_NULL)
Evar2 estr2=(LPCSTR) (_bstr_t);
_variant_t evar3=m_pRecordSet3 - & gt; GetCollect (" post ");
Cstrings estr3;
If (evar3 vt!=VT_NULL)
Evar3 estr3=(LPCSTR) (_bstr_t);
_variant_t evar4=m_pRecordSet3 - & gt; GetCollect (" test ");
Cstrings estr4;
If (evar4 vt!=VT_NULL)
Evar4 estr4=(LPCSTR) (_bstr_t); No.//test
_variant_t evar5=m_pRecordSet3 - & gt; GetCollect (" qualified scores ");
Cstrings estr5;
If (evar5 vt!=VT_NULL)
Evar5 estr5=(LPCSTR) (_bstr_t);
_variant_t evar6=m_pRecordSet3 - & gt; GetCollect (" save code ");
Cstrings estr6;
If (evar6 vt!=VT_NULL)
Evar6 estr6=(LPCSTR) (_bstr_t);
If (md5 (estr1 + estr2 + estr3 + + estr5 estr4)!=estr6)
{
MessageBox (_T (" database has been tampered with, to the test!" ), _T (" Saes tips "));
M_ADOConn. ExitConnect ();//disconnect database
return;
}
M_pRecordSet3 - & gt; MoveNext ();
}
M_ADOConn. ExitConnect ();//disconnect database
CDialog: : OnOK ();//to close the dialog
CExamLogin DLG.
DLG. DoModal ();
}