Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help Please. Pin
FISH7867-Mar-09 15:04
FISH7867-Mar-09 15:04 
Questionabout MBCS and unicode in Visual C++ 2005 Pin
DSPCottage7-Mar-09 7:42
DSPCottage7-Mar-09 7:42 
AnswerRe: about MBCS and unicode in Visual C++ 2005 Pin
Code-o-mat7-Mar-09 9:32
Code-o-mat7-Mar-09 9:32 
AnswerRe: about MBCS and unicode in Visual C++ 2005 Pin
«_Superman_»7-Mar-09 13:45
professional«_Superman_»7-Mar-09 13:45 
QuestionWhat datatype?? Pin
gothic_coder7-Mar-09 7:39
gothic_coder7-Mar-09 7:39 
AnswerRe: What datatype?? Pin
Perspx7-Mar-09 8:31
Perspx7-Mar-09 8:31 
AnswerRe: What datatype?? Pin
Stuart Dootson7-Mar-09 12:10
professionalStuart Dootson7-Mar-09 12:10 
GeneralRe: What datatype?? Pin
gothic_coder7-Mar-09 19:16
gothic_coder7-Mar-09 19:16 
GeneralRe: What datatype?? Pin
Stuart Dootson8-Mar-09 0:35
professionalStuart Dootson8-Mar-09 0:35 
GeneralRe: What datatype?? Pin
gothic_coder8-Mar-09 20:23
gothic_coder8-Mar-09 20:23 
GeneralRe: What datatype?? Pin
Stuart Dootson8-Mar-09 22:06
professionalStuart Dootson8-Mar-09 22:06 
GeneralRe: What datatype?? Pin
gothic_coder8-Mar-09 22:22
gothic_coder8-Mar-09 22:22 
GeneralRe: What datatype?? Pin
Stuart Dootson9-Mar-09 3:35
professionalStuart Dootson9-Mar-09 3:35 
GeneralRe: What datatype?? Pin
gothic_coder9-Mar-09 5:33
gothic_coder9-Mar-09 5:33 
GeneralRe: What datatype?? Pin
gothic_coder9-Mar-09 6:21
gothic_coder9-Mar-09 6:21 
QuestionWindows Hook for Dialog Box Pin
M_Aurelius7-Mar-09 7:37
M_Aurelius7-Mar-09 7:37 
AnswerRe: Windows Hook for Dialog Box Pin
«_Superman_»7-Mar-09 13:57
professional«_Superman_»7-Mar-09 13:57 
QuestionPlease help and need advice. Pin
FISH7867-Mar-09 3:43
FISH7867-Mar-09 3:43 
AnswerRe: Please help and need advice. Pin
«_Superman_»7-Mar-09 14:16
professional«_Superman_»7-Mar-09 14:16 
GeneralRe: Please help and need advice. Pin
FISH7867-Mar-09 14:32
FISH7867-Mar-09 14:32 
GeneralRe: Please help and need advice. Pin
«_Superman_»7-Mar-09 14:38
professional«_Superman_»7-Mar-09 14:38 
GeneralRe: Please help and need advice. Pin
FISH7867-Mar-09 15:15
FISH7867-Mar-09 15:15 
QuestionDisplaying Chinese character. Pin
gothic_coder7-Mar-09 2:56
gothic_coder7-Mar-09 2:56 
AnswerRe: Displaying Chinese character. Pin
Code-o-mat7-Mar-09 3:26
Code-o-mat7-Mar-09 3:26 
GeneralRe: Displaying Chinese character. Pin
gothic_coder7-Mar-09 3:46
gothic_coder7-Mar-09 3:46 
This is what i'm doing...
_bstr_t bstrString_Ini;
 _bstr_t bstrString_Tag;
 _bstr_t bstrString_Dest;
 char sqlQuery[2 * MAX_PATH] = "";
 sprintf(sqlQuery, "SELECT IniSection,TagName,DestinationValue FROM %s WHERE FileName = '%s'" , szTableName, szstr);
 _bstr_t sqlQueryText(sqlQuery);

 try
 {
     ADODB::_CommandPtr m_objCmdSearch;
     ADODB::_RecordsetPtr m_cpRecordsetSearch;

     //Create instance of command object
     HRESULT hr = m_objCmdSearch.CreateInstance("ADODB.Command");
     if(SUCCEEDED(hr))
     {
         //Set the active connection property of command object to open connection
         m_objCmdSearch->ActiveConnection = m_cpConnection;

         //Set command object's command type to text
         m_objCmdSearch->CommandType = ADODB::adCmdText;

         //Set Command Text
         m_objCmdSearch->CommandText = sqlQueryText;

         //Execute command and get results in Recordset object
         m_cpRecordsetSearch = m_objCmdSearch->Execute(NULL, NULL, ADODB::adCmdText);
         if(m_cpRecordsetSearch != NULL)
         {
             if(!m_cpRecordsetSearch->GetEndOfFile())
             {
                 char szstr[MAX_PATH];
                 char szstr1[MAX_PATH];

                 m_cpRecordsetSearch->MoveFirst();

                 while(!m_cpRecordsetSearch->EndOfFile)
                 {
                     bstrString_Ini = m_cpRecordsetSearch->Fields->GetItem("IniSection")->GetValue().bstrVal;
                     bstrString_Tag = m_cpRecordsetSearch->Fields->GetItem("TagName")->GetValue().bstrVal;
                     bstrString_Dest = m_cpRecordsetSearch->Fields->GetItem("DestinationValue")->GetValue().bstrVal;

                     m_cpRecordsetSearch->MoveNext();
                 }


                 rVal = TRUE;
             }

             if((m_cpRecordsetSearch->State &  ADODB::adStateOpen) != 0)
             {
                 m_cpRecordsetSearch->Close();
                 m_cpRecordsetSearch = NULL;
             }
         }

         m_objCmdSearch->PutRefActiveConnection(NULL);
     }
 }



And i get "Abc ????" in bstrString_Dest... Which is defined as _bstr_t...
bstrString_Dest = cpRecordsetSearch->Fields->GetItem("DestinationValue")->GetValue().bstrVal;


What else do i need to do.. I've enabled unicode in my project..

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.