CDaoRecordset If a field Exists in MFC C++ -
how check if given field name exists in access database table using vc++ daorecordset. tried google , msdn documentation find useful.
i tried following code:
bool isfieldexixts(cdaorecordset *rs, cstring fieldname) { colevariant ov; try { rs->getfieldvalue(fieldname,ov); } catch(cdaoexception e) { return false; } return true }
but instead of raising exception when not found, displays messagebox stating item not found.
i need c++ solution, can find on google vb solutions
getfieldvalue
not display messagebox. catch
block not correct, need
catch(cdaoexception *e) { e->delete(); return false; }
so in program exception not handled in code. in mfc top level function default handler exceptions invoked , 1 displaying messagebox.
btw, check if entry exists in recordset can call cdaorecordset::iseof
.
Comments
Post a Comment