if (StuInfoSet->IsOpen())
StuInfoSet->Close();
StuInfoSet->Open(CRecordset::snapshot,"Select * From StuInfo");
每次打开数据库都要写这几句,能不能写一个函数,只传入参数:StuInfoSet就行了呢?
StuInfoSet->Close();
StuInfoSet->Open(CRecordset::snapshot,"Select * From StuInfo");
每次打开数据库都要写这几句,能不能写一个函数,只传入参数:StuInfoSet就行了呢?
{\
if(x->->IsOpen()) x->Close();\
x->Open(CRecordset::snapshot,"Select * From StuInfo");\
}使用就和函数差不多