Click here to Skip to main content
15,884,425 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVC++ 8 Doc tool Pin
Fernando A. Gomez F.31-May-06 19:39
Fernando A. Gomez F.31-May-06 19:39 
AnswerRe: VC++ 8 Doc tool [modified] Pin
Stephen Hewitt31-May-06 19:42
Stephen Hewitt31-May-06 19:42 
GeneralRe: VC++ 8 Doc tool [modified] Pin
Fernando A. Gomez F.1-Jun-06 4:10
Fernando A. Gomez F.1-Jun-06 4:10 
GeneralRe: VC++ 8 Doc tool [modified] Pin
Stephen Hewitt1-Jun-06 13:45
Stephen Hewitt1-Jun-06 13:45 
GeneralRe: VC++ 8 Doc tool [modified] Pin
Fernando A. Gomez F.1-Jun-06 13:52
Fernando A. Gomez F.1-Jun-06 13:52 
QuestionContext menu extensions Pin
Anil_vvs31-May-06 19:22
Anil_vvs31-May-06 19:22 
AnswerRe: Context menu extensions Pin
Anil_vvs31-May-06 19:26
Anil_vvs31-May-06 19:26 
Questionvc++ Pin
Y_Kaushik31-May-06 18:58
Y_Kaushik31-May-06 18:58 
Hai to all of you
i am doing my project in VC++ as Front End and MySQL as an Back End,
i am feeling some problem whenever i insert data using Form (VC++ dialog based form) i am sending some line of code written below .Please help me
where i am wrong........

void CEmpDetail::OnSubmit()
{
int i, j;
MYSQL * Conn;
MYSQL_RES * res;
MYSQL_ROW row;
CString sDAt,sEmpid,sEmpf,sEmpl,sDes,iPh,iEx,dDt,sMm,iYy,sQf,sTs,iTx,iHcx,sVis,sLoc,iOdc,sPrj,sGp,iPk,sMid,iFs,iOs;
CString sStr;
if ( (Conn = mysql_init((MYSQL*) 0)) &&
mysql_real_connect( Conn, "localhost", "", NULL, NULL, MYSQL_PORT, NULL, CLIENT_MULTI_STATEMENTS ) )
{
if ( mysql_select_db( Conn, "project") < 0 )
{
SetDlgItemText(IDC_STATIC_LOGIN_MSG, "Can't select the database !\nTry later.") ;
goto exit_here;
}
}
else
{
SetDlgItemText(IDC_STATIC_LOGIN_MSG, "Can't connect to the mysql server !\nPlease try later.") ;
goto exit_here;
}

GetDlgItemText(IDC_EMPID,sEmpid) ; ///////// Getting emp id from user
GetDlgItemText(IDC_EMPNMF,sEmpf) ;/////////emp first name
GetDlgItemText(IDC_EMPNML,sEmpl) ;///////////emp last name
GetDlgItemText(IDC_DESIGNATION,sDes) ;/////////////emp designation
GetDlgItemText(IDC_PHONENO,iPh) ;///////////phone
GetDlgItemText(IDC_EXTEN,iEx) ;//////////ext
GetDlgItemText(IDC_COMBO_DD,dDt) ;////////date
GetDlgItemText(IDC_COMBO_MM,sMm) ;////////Month
GetDlgItemText(IDC_COMBO_YY,iYy) ;////////Year
GetDlgItemText(IDC_EDIT_QFLN,sQf) ;/////qualification
GetDlgItemText(IDC_EDIT_TKSKL,sTs) ;/////////////////technical skill
GetDlgItemText(IDC_EDIT_TOTAL,iTx) ;///////////total exp
GetDlgItemText(IDC_EDIT_HCL,iHcx) ;///////hcl exp
GetDlgItemText(IDC_EDIT_VISA,sVis) ;//////////visa
GetDlgItemText(IDC_LOC,sLoc) ;////////////////loc
GetDlgItemText(IDC_ODC,iOdc) ;//////////odc
GetDlgItemText(IDC_PROJID,sPrj) ;/////////proj
GetDlgItemText(IDC_GROUP,sGp) ;///////////////group
GetDlgItemText(IDC_PACKAGE,iPk) ;//////////////package
GetDlgItemText(IDC_EMPMAIL,sMid) ;///////mail id
GetDlgItemText(IDC_OFFSH,iFs) ;/////////////////offshore
GetDlgItemText(IDC_ONSH,iOs) ;/////////onsite"vas"

if (!mysql_query( Conn,"INSERT INTO emp VALUES (\'" + sEmpid + "\',\'" + sEmpf + "\',\'" + sEmpl + "\',\'" + sDes + "\',\'" + iPh + "\',\'" + iEx + "\',\'" + dDt + "\',\'" + sMm + "\',\" + iYy + "\',\'" + sQf + "\',\'" + sTs + "\',\'" + iTx + "\',\'" + iHcx + "\',\'" + sVis + "\',\'" + sLoc + "\',\'" + iOdc + "\',\'" + sPrj + "\',\'" + sGp + "\,\'" + iPk + "\',\'" + sMid + "\',0,1)")))
{
res = mysql_store_result(Conn);
if(res)
{
MessageBox("Your Data Submit Successfully","Yse...",MB_ICONASTERISK);

}

else
{
MessageBox("Data Not Submitted","Error...",MB_ICONQUESTION);
goto exit_here;
}
}
else
{
MessageBox(" Query Not Execute ","Error...",MB_ICONQUESTION);
goto exit_here;
}



exit_here:
mysql_close( Conn );
UpdateData(FALSE);

}

i think i am lack of using any API Please help me where i am wrong.
Thanking you
Yogendra kumar kaushik

mailing me
Yogi
AnswerRe: vc++ Pin
Stephen Hewitt31-May-06 19:40
Stephen Hewitt31-May-06 19:40 
AnswerRe: vc++ [modified] Pin
NiceNaidu31-May-06 19:47
NiceNaidu31-May-06 19:47 
GeneralRe: vc++ Pin
NiceNaidu31-May-06 19:50
NiceNaidu31-May-06 19:50 
AnswerRe: vc++ Pin
Steve Echols31-May-06 20:07
Steve Echols31-May-06 20:07 
AnswerRe: vc++ Pin
David Crow1-Jun-06 4:15
David Crow1-Jun-06 4:15 
QuestionDoes vc7/8 supprot declare a variable in switch case? Pin
followait31-May-06 18:46
followait31-May-06 18:46 
AnswerRe: Does vc7/8 supprot declare a variable in switch case? Pin
_AnsHUMAN_ 31-May-06 18:49
_AnsHUMAN_ 31-May-06 18:49 
GeneralRe: Does vc7/8 supprot declare a variable in switch case? Pin
Steve Mayfield31-May-06 19:30
Steve Mayfield31-May-06 19:30 
GeneralRe: Does vc7/8 supprot declare a variable in switch case? Pin
_AnsHUMAN_ 31-May-06 19:36
_AnsHUMAN_ 31-May-06 19:36 
GeneralRe: Does vc7/8 supprot declare a variable in switch case? Pin
David Crow1-Jun-06 4:17
David Crow1-Jun-06 4:17 
Questionlink two visual projects [modified] Pin
widoxs31-May-06 18:39
widoxs31-May-06 18:39 
AnswerRe: link two visual projects [modified] Pin
NiceNaidu31-May-06 18:55
NiceNaidu31-May-06 18:55 
QuestionMemory problem Pin
Anu_Bala31-May-06 18:20
Anu_Bala31-May-06 18:20 
AnswerRe: Memory problem Pin
Hamid_RT31-May-06 18:29
Hamid_RT31-May-06 18:29 
AnswerRe: Memory problem [modified] Pin
Nibu babu thomas31-May-06 19:05
Nibu babu thomas31-May-06 19:05 
QuestionRe: Memory problem [modified] Pin
David Crow1-Jun-06 4:20
David Crow1-Jun-06 4:20 
AnswerRe: Memory problem [modified] Pin
Nibu babu thomas1-Jun-06 17:23
Nibu babu thomas1-Jun-06 17:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.