Click here to Skip to main content
15,890,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCOleControl? Pin
raghuji.rao8-Jun-06 23:45
raghuji.rao8-Jun-06 23:45 
QuestionHow do I open file excel in VC++. Pin
Vu Ngoc Quyen8-Jun-06 23:35
Vu Ngoc Quyen8-Jun-06 23:35 
AnswerRe: How do I open file excel in VC++. Pin
raghuji.rao8-Jun-06 23:42
raghuji.rao8-Jun-06 23:42 
GeneralRe: How do I open file excel in VC++. Pin
XalanXalan9-Jun-06 1:30
XalanXalan9-Jun-06 1:30 
GeneralRe: How do I open file excel in VC++. Pin
raghuji.rao9-Jun-06 22:18
raghuji.rao9-Jun-06 22:18 
QuestionRe: How do I open file excel in VC++. Pin
David Crow9-Jun-06 3:39
David Crow9-Jun-06 3:39 
AnswerRe: How do I open file excel in VC++. Pin
ThatsAlok11-Jun-06 22:04
ThatsAlok11-Jun-06 22:04 
QuestionLogin program problem Pin
yogendra kaushik8-Jun-06 23:22
yogendra kaushik8-Jun-06 23:22 
Hello all's
i am new in VC++ and feel some problem in my program
i am trying to making a login program but in some line
i think i am wrong .The code of that line are below
can any one help me and also tell me where i am wrong

int i, j, k;
MYSQL * myDB ;
MYSQL_RES * res,*res1;
MYSQL_ROW row,row1;
CString sStr, sPwd;


SetDlgItemText(IDC_STATIC, "Logging in. Please wait...");

if ( (myDB = mysql_init((MYSQL*) 0)) &&
mysql_real_connect( myDB, "localhost", " ", NULL, NULL, MYSQL_PORT, NULL, CLIENT_MULTI_STATEMENTS ) )
{
if ( mysql_select_db( myDB, "login") < 0 )
{
SetDlgItemText(IDC_STATIC, "Can't select the database !\nTry later.") ;
goto exit_here;
}
}
else
{
SetDlgItemText(IDC_STATIC, "Can't connect to the mysql server !\nPlease try later.") ;
goto exit_here;
}

sStr.Empty();
GetDlgItemText(IDC_USER, sStr);
sStr = "CALL sp_auth_user(\'" + sStr + "\', \'";
GetDlgItemText(IDC_PASS, sPwd);
sStr = sStr + sPwd + "\');";
if (!mysql_query( myDB, sStr) )
{
res = mysql_store_result( myDB ) ;
i = (int) mysql_num_rows( res );
if (i != 1)
{
SetDlgItemText(IDC_STATIC, "Incorrect User Name / Password. Please try again.");
mysql_free_result( res ) ;
goto exit_here;
}
SetDlgItemText(IDC_STATIC, "Login Successful.");
if ( (row = mysql_fetch_row( res )) )
{
sStr.Empty();
j = mysql_num_fields( res ) ;
//for ( k = 0 ; k < j ; k++ )
// sStr += (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k]) ;
sStr = "Welcome - ";
sStr += (((row[2]==NULL)||(!strlen(row[2])))?"NULL":row[2]) ; // Name
sStr += " (";
sStr += (((row[1]==NULL)||(!strlen(row[1])))?"NULL":row[1]) ; // Group
sStr += ")";
SetDlgItemText(IDC_STATIC, sStr);
}
mysql_free_result( res ) ;
}
else
SetDlgItemText(IDC_STATIC, "Could not execute query on server.") ;

Please mailing me
AnswerRe: Login program problem [modified] Pin
_AnsHUMAN_ 8-Jun-06 23:28
_AnsHUMAN_ 8-Jun-06 23:28 
GeneralRe: Login program problem [modified] Pin
yogendra kaushik8-Jun-06 23:38
yogendra kaushik8-Jun-06 23:38 
QuestionImprove Performance of CRecordset Pin
Leonard8-Jun-06 23:07
Leonard8-Jun-06 23:07 
QuestionKeyboard focus to ActiveX control Pin
Andrew Hoole8-Jun-06 23:02
Andrew Hoole8-Jun-06 23:02 
AnswerRe: Keyboard focus to ActiveX control Pin
Stephen Hewitt8-Jun-06 23:17
Stephen Hewitt8-Jun-06 23:17 
GeneralRe: Keyboard focus to ActiveX control Pin
Andrew Hoole9-Jun-06 0:45
Andrew Hoole9-Jun-06 0:45 
QuestionRe: Keyboard focus to ActiveX control Pin
Viorel.8-Jun-06 23:33
Viorel.8-Jun-06 23:33 
AnswerRe: Keyboard focus to ActiveX control Pin
Andrew Hoole9-Jun-06 0:48
Andrew Hoole9-Jun-06 0:48 
AnswerRe: Keyboard focus to ActiveX control Pin
Andrew Hoole9-Jun-06 0:43
Andrew Hoole9-Jun-06 0:43 
Questiondate fetch problem Pin
yogendra kaushik8-Jun-06 22:59
yogendra kaushik8-Jun-06 22:59 
AnswerRe: date fetch problem Pin
Cedric Moonen8-Jun-06 23:02
Cedric Moonen8-Jun-06 23:02 
GeneralRe: date fetch problem Pin
yogendra kaushik8-Jun-06 23:14
yogendra kaushik8-Jun-06 23:14 
AnswerRe: date fetch problem Pin
_AnsHUMAN_ 8-Jun-06 23:05
_AnsHUMAN_ 8-Jun-06 23:05 
AnswerRe: date fetch problem Pin
yogendra kaushik8-Jun-06 23:24
yogendra kaushik8-Jun-06 23:24 
AnswerRe: date fetch problem Pin
Laxman Auti9-Jun-06 0:04
Laxman Auti9-Jun-06 0:04 
Questionneed help in subclass a non MFC control Pin
Haitham Khedre8-Jun-06 22:35
Haitham Khedre8-Jun-06 22:35 
QuestionHow can I append LPTSTR to CStirng Pin
NoName II8-Jun-06 22:22
NoName II8-Jun-06 22:22 

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.