in order to make things clearer .i give a part of code (the codes functions as to connect the data base and execute the SQL statement ):
BUT at first used this way of executing SQL statement .i am content with the followingCode:try { CDatabase cdb; CRecordset recset(&cdb); cdb.open(); CString strQuery="select * from Customer"; recset.open(CRecordset::forwordOnly,strQuery); cdb.close() } catch(CDBException& e) { CString errorMessage; errorMessage.Format("ODBC=%d%s",e.m_strerror/*sorry there maybe a mistake*/) ; AfxMessageBox("the data file can not be executed because of this error"); }
I get something from people telling that using ExecuteSQL will damage the ODBC non-dependence ,so i choose the first version and i am also contented that i have added exceptions to the database.Code:CDatabase cdb; CString strQuery="select * from Customer"; cdb.ExecuteSQL(strQuery);
however ,what i have done doesnot change the fate----no result and it doesnot allow my loggining ,and now i try .....
yeah i hope that i can get some helps from u ,ok?
much appreciation !
jolley
Regards.




Reply With Quote