i have searched alooooot for last 4 days..i have read allll the questions and articles and evry thing .. but i cant figure it out
my question is :
i have an mfc application connected to a sql server database via odbc
i want to lock a row when im editing it
its easy in many ereas .. even there is a fuction defined in crecordset named
that can has optimistic or pessimistic input parametere.. my ideal is that this function do the work for me with oessimistic parametere.. but when i run the app it says that my driver doesnt support pessimistic locking mode
and i have read that few odbc drivers support that(and i have no idea what does it mean!)
i should lock the row..
i have tried the function executesql function i have tried transactions .. but yet cant understand what is my way .. and how they work..
here is my handler function on edit button:
if (m_pSet->CanUpdate() && !m_pSet->IsDeleted())
if (MessageBox(_T("are you sure that you want to edit this record?"), _T("Attention:"), MB_YESNO | MB_ICONQUESTION) == IDYES)
MessageBox(_T("Row Edited\n"), _T("done:"), MB_ICONASTERISK);
MessageBox(_T("Row Cant be Edited\nor u didnt change any field to edit"), _T("Warning:"), MB_ICONWARNING);
MessageBox(_T("Row Not Edited\n"), _T("done:"), MB_ICONASTERISK);
plzz help me to get rid of this terrible headache:(