Click here to Skip to main content
15,843,623 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Showing "Passord" Text image Pin
Stuart Dootson14-May-09 2:09
professionalStuart Dootson14-May-09 2:09 
QuestionProcess that continues after you logoff Pin
andypandy213-May-09 23:36
andypandy213-May-09 23:36 
AnswerRe: Process that continues after you logoff Pin
Madhu Nair13-May-09 23:45
Madhu Nair13-May-09 23:45 
GeneralRe: Process that continues after you logoff Pin
andypandy214-May-09 2:15
andypandy214-May-09 2:15 
QuestionSQL Query In ADO MFC/Visual C++ Pin
Astitva2313-May-09 23:26
Astitva2313-May-09 23:26 
AnswerRe: SQL Query In ADO MFC/Visual C++ Pin
Madhu Nair13-May-09 23:39
Madhu Nair13-May-09 23:39 
QuestionRe: SQL Query In ADO MFC/Visual C++ [modified] Pin
Astitva2314-May-09 0:48
Astitva2314-May-09 0:48 
AnswerRe: SQL Query In ADO MFC/Visual C++ Pin
Stuart Dootson14-May-09 2:01
professionalStuart Dootson14-May-09 2:01 
Rather than building a query string embedding the parameter value (can we say SQL Injection[^]?), I'd suggest you build a parameterised query[^].

For what you want, this would want something like:

// Create Command Object.
       Cmd1.CreateInstance( __uuidof( ADODB::Command ) );
       Cmd1->ActiveConnection = your connection;
       Cmd1->CommandText = _bstr_t(L"SELECT Name FROM EmployeeDetails WHERE Name=?");

       // Create Parameter Object.
       Param1 = Cmd1->CreateParameter( _bstr_t(L""),
                                       ADODB::adVarChar,
                                       ADODB::adParamInput,
                                       -1,
                                       _variant_t(_bstr_t(m_EditBoxValue) );
       Cmd1->Parameters->Append( Param1 );

       // Open Recordset Object.
       m_pRS = Cmd1->Execute( &vtEmpty, &vtEmpty2, ADODB::adCmdText );


To use the LIKE operator, just replace WHERE Name=? with WHERE Name LIKE ?

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

QuestionRe: SQL Query In ADO MFC/Visual C++ Pin
Astitva2314-May-09 2:43
Astitva2314-May-09 2:43 
AnswerRe: SQL Query In ADO MFC/Visual C++ Pin
Stuart Dootson14-May-09 3:32
professionalStuart Dootson14-May-09 3:32 
QuestionExtended MAPI - embedding an attachment inside the message Pin
yakobom13-May-09 22:15
yakobom13-May-09 22:15 
AnswerRe: Extended MAPI - embedding an attachment inside the message Pin
Madhu Nair13-May-09 23:29
Madhu Nair13-May-09 23:29 
GeneralRe: Extended MAPI - embedding an attachment inside the message Pin
yakobom13-May-09 23:51
yakobom13-May-09 23:51 
GeneralRe: Extended MAPI - embedding an attachment inside the message Pin
Madhu Nair14-May-09 0:16
Madhu Nair14-May-09 0:16 
QuestionOperating system hangs up + watchdog application for windows Pin
eli1502197913-May-09 20:07
eli1502197913-May-09 20:07 
AnswerRe: Operating system hangs up + watchdog application for windows Pin
«_Superman_»13-May-09 20:12
professional«_Superman_»13-May-09 20:12 
GeneralRe: Operating system hangs up + watchdog application for windows Pin
eli1502197913-May-09 21:23
eli1502197913-May-09 21:23 
GeneralRe: Operating system hangs up + watchdog application for windows Pin
«_Superman_»13-May-09 21:50
professional«_Superman_»13-May-09 21:50 
GeneralRe: Operating system hangs up + watchdog application for windows Pin
eli1502197913-May-09 22:00
eli1502197913-May-09 22:00 
GeneralRe: Operating system hangs up + watchdog application for windows Pin
«_Superman_»13-May-09 22:10
professional«_Superman_»13-May-09 22:10 
QuestionRe: Operating system hangs up + watchdog application for windows Pin
David Crow14-May-09 4:03
David Crow14-May-09 4:03 
Questiondirect map Pin
shefa' isied13-May-09 19:40
shefa' isied13-May-09 19:40 
AnswerRe: direct map Pin
Franck Paquier13-May-09 20:07
Franck Paquier13-May-09 20:07 
QuestionSimple Question about Tool Bars Pin
Software200713-May-09 18:09
Software200713-May-09 18:09 
AnswerRe: Simple Question about Tool Bars Pin
Chandrasekharan P13-May-09 18:20
Chandrasekharan P13-May-09 18:20 

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.