HadiRezaee
Technical User
I'm writing program about database.
In my database i have 3 tables:
CDINFO, PERSON, GETGIVE
And i have 3 fields in CDINFO table:
FILMNAME ---> Text
FILMCODE ---> Integer
COUNT ---> Integer
I'm using of three objects of CDaoRecordset for opening each table ...
Now, i want to add new record in CDINFO:
COleVariant var;
char *szFilm = new char[50];
var.vt = VT_INT;
GetDlgItemText(IDC_EDIT1, szFilm, 50);
var.intVal = GetDlgItemInt(IDC_EDIT2);
m_rsCDINFO->AddNew();
m_rsCDINFO->SetFieldValue("FILMCODE", var);
m_rsCDINFO->SetFieldValue("FILMNAME", szFilm);
m_rsCDINFO->SetFieldValue("COUNT", var);
m_rsCDINFO->Update();
SetDlgItemText(IDC_EDIT1, ""
SetDlgItemText(IDC_EDIT2, ""
delete[] szFilm;
This code have not any error or warning, but when i'll running this code, program indicate to me error about: "Out of memory" !!!
Please tell me, what is my wrong ?
In my database i have 3 tables:
CDINFO, PERSON, GETGIVE
And i have 3 fields in CDINFO table:
FILMNAME ---> Text
FILMCODE ---> Integer
COUNT ---> Integer
I'm using of three objects of CDaoRecordset for opening each table ...
Now, i want to add new record in CDINFO:
COleVariant var;
char *szFilm = new char[50];
var.vt = VT_INT;
GetDlgItemText(IDC_EDIT1, szFilm, 50);
var.intVal = GetDlgItemInt(IDC_EDIT2);
m_rsCDINFO->AddNew();
m_rsCDINFO->SetFieldValue("FILMCODE", var);
m_rsCDINFO->SetFieldValue("FILMNAME", szFilm);
m_rsCDINFO->SetFieldValue("COUNT", var);
m_rsCDINFO->Update();
SetDlgItemText(IDC_EDIT1, ""
SetDlgItemText(IDC_EDIT2, ""
delete[] szFilm;
This code have not any error or warning, but when i'll running this code, program indicate to me error about: "Out of memory" !!!
Please tell me, what is my wrong ?