Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionResize Dialog Box Pin
siva45519-Jun-09 6:05
siva45519-Jun-09 6:05 
AnswerRe: Resize Dialog Box Pin
p_196019-Jun-09 10:05
p_196019-Jun-09 10:05 
GeneralRe: Resize Dialog Box Pin
Stuart Dootson19-Jun-09 12:43
professionalStuart Dootson19-Jun-09 12:43 
GeneralRe: Resize Dialog Box Pin
siva45519-Jun-09 17:16
siva45519-Jun-09 17:16 
AnswerRe: Resize Dialog Box Pin
Ozer Karaagac19-Jun-09 11:47
professionalOzer Karaagac19-Jun-09 11:47 
GeneralRe: Resize Dialog Box Pin
siva45519-Jun-09 17:12
siva45519-Jun-09 17:12 
AnswerRe: Resize Dialog Box Pin
Madhu Nair20-Jun-09 6:37
Madhu Nair20-Jun-09 6:37 
QuestionHow to modify sql text field using c++ Pin
thebouge19-Jun-09 5:37
thebouge19-Jun-09 5:37 
Hi,
I need to write some code in C++ that will connect to an SQL table, run a query and then modify a text field in the SQL table if a condition is met. In the code below, if the Blend Status field = "APP" in the SQL table, I want to change it to "DNL". With the code below, I get the following error on the line "custatus.m_BlendStatus = "DNL";" when I compile:
error C2106: '=' : left operand must be l-value on the line "custatus.m_BlendStatus = "DNL";"

I'm not sure what the problem is or how to fix it. Any help would be appreciated.

Thanks in advance.

<pre>#include "stdafx.h"

#include "all_tool.h"

#include <atldbcli.h>
#include <string.h>    
#include <time.h>

class CCUSTATUSAccessor
   {
   public:
        TCHAR m_Id[50];
        TCHAR m_RevisionId[50];
        TCHAR m_BlenderId[50];
               TCHAR m_BlendStatus[4];
        DATE m_DateModified;     
        //output binding map
        BEGIN_COLUMN_MAP(CCUSTATUSAccessor)
          COLUMN_ENTRY(1, m_Id)
          COLUMN_ENTRY(2, m_RevisionId)
          COLUMN_ENTRY(3, m_BlenderId)
          COLUMN_ENTRY(4, m_BlendStatus)
          COLUMN_ENTRY(5, m_DateModified)

        END_COLUMN_MAP()

   };


CString BIName;
CString BIRevision;
CString BIStatus;
int ConnectOK = 0;
int a = 0;
time_t now;
         
HRESULT hr ;
hr = CoInitialize(NULL);

CDataSource ds;
CSession session;
CDBPropSet propSet(DBPROPSET_DBINIT);
propSet.AddProperty(DBPROP_AUTH_INTEGRATED, OLESTR("SSPI"));      //Windows NT Authentication('SSPI')
propSet.AddProperty(DBPROP_INIT_CATALOG, "AmmDb");               //Database Name
propSet.AddProperty(DBPROP_INIT_DATASOURCE, "WOpenBPC");   //Computer Node Name
    
hr = ds.Open(_T("SQLOLEDB.1"), &amp;propSet);

if(SUCCEEDED(hr))
{
     ConnectOK = 1;
}

if (ConnectOK == 1)
{
     hr = session.Open(ds);
     if (SUCCEEDED(hr))
     {
               //Get the Blend Order Name and Revision                   
          io.GetFromDatapool(BIName, DataLoc, "BlendOrderName");
          io.GetFromDatapool(BIRevision, DataLoc, "BlendOrderRevision");
          CCommand&lt;CAccessor&lt;CCUSTATUSAccessor&gt; &gt; custatus;    
          hr = custatus.Open( session, "Select * FROM CU_STATUS WHERE (Id = " + BIName + ") AND (Revision = " + BIRevision + ")" , &propSet);
          if (SUCCEEDED(hr))
          {
               //Update the Blend Status when the blend is loaded to OpenBPC.
               hr=custatus.MoveFirst();
               if (SUCCEEDED(hr))
               {
                    time (&now);
                    if (custatus.m_BlendStatus == "APP")
                    {
                         <b>custatus.m_BlendStatus = "DNL";</b>
                         hr = custatus.SetData();
                         custatus.Update();
                         custatus.m_DateModified = now;
                         hr = custatus.SetData();
                         custatus.Update();
                    }
                    else
                    {
                         custatus.m_DateModified = now;
                         hr = custatus.SetData();
                         custatus.Update();
                    }
               }
          }
     }
}
else
a=1.0;</pre>
AnswerRe: How to modify sql text field using c++ Pin
led mike19-Jun-09 5:42
led mike19-Jun-09 5:42 
GeneralRe: How to modify sql text field using c++ Pin
thebouge19-Jun-09 6:59
thebouge19-Jun-09 6:59 
GeneralRe: How to modify sql text field using c++ Pin
David Crow19-Jun-09 7:50
David Crow19-Jun-09 7:50 
AnswerRe: How to modify sql text field using c++ Pin
David Crow19-Jun-09 5:58
David Crow19-Jun-09 5:58 
QuestionHelp! How to recover the VC++6.0 project without .res folder?? Pin
kedanz19-Jun-09 4:25
kedanz19-Jun-09 4:25 
AnswerRe: Help! How to recover the VC++6.0 project without .res folder?? Pin
Stuart Dootson19-Jun-09 4:34
professionalStuart Dootson19-Jun-09 4:34 
GeneralRe: Help! How to recover the VC++6.0 project without .res folder?? Pin
«_Superman_»19-Jun-09 16:41
professional«_Superman_»19-Jun-09 16:41 
GeneralRe: Help! How to recover the VC++6.0 project without .res folder?? Pin
Stuart Dootson20-Jun-09 13:49
professionalStuart Dootson20-Jun-09 13:49 
AnswerRe: Help! How to recover the VC++6.0 project without .res folder?? Pin
Alan Balkany22-Jun-09 4:11
Alan Balkany22-Jun-09 4:11 
QuestionHelp with threads. Pin
FISH78619-Jun-09 4:04
FISH78619-Jun-09 4:04 
AnswerRe: Help with threads. Pin
Chris Losinger19-Jun-09 4:27
professionalChris Losinger19-Jun-09 4:27 
GeneralRe: Help with threads. Pin
FISH78619-Jun-09 4:31
FISH78619-Jun-09 4:31 
GeneralRe: Help with threads. Pin
Chris Losinger19-Jun-09 4:38
professionalChris Losinger19-Jun-09 4:38 
AnswerRe: Help with threads. Pin
Ozer Karaagac19-Jun-09 4:54
professionalOzer Karaagac19-Jun-09 4:54 
AnswerRe: Help with threads. Pin
«_Superman_»19-Jun-09 16:48
professional«_Superman_»19-Jun-09 16:48 
GeneralRe: Help with threads. Pin
FISH78619-Jun-09 17:25
FISH78619-Jun-09 17:25 
QuestionCan we use registry for.. Pin
ramana.g19-Jun-09 2:56
ramana.g19-Jun-09 2:56 

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.