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

C / C++ / MFC

 
GeneralRe: Possible to link to different projects together? Pin
rover_boy16-Jan-08 0:57
rover_boy16-Jan-08 0:57 
GeneralRe: Possible to link to different projects together? Pin
David Crow16-Jan-08 2:37
David Crow16-Jan-08 2:37 
GeneralRe: Possible to link to different projects together? Pin
rover_boy16-Jan-08 3:46
rover_boy16-Jan-08 3:46 
GeneralRe: Possible to link to different projects together? Pin
David Crow16-Jan-08 3:49
David Crow16-Jan-08 3:49 
AnswerRe: Possible to link to different projects together? Pin
Hamid_RT16-Jan-08 0:34
Hamid_RT16-Jan-08 0:34 
GeneralRe: Possible to link to different projects together? Pin
rover_boy16-Jan-08 0:55
rover_boy16-Jan-08 0:55 
GeneralRe: Possible to link to different projects together? Pin
Hamid_RT16-Jan-08 7:23
Hamid_RT16-Jan-08 7:23 
GeneralWrite values to a database within the C++ code Pin
CodingLover15-Jan-08 23:45
CodingLover15-Jan-08 23:45 
Hi all,

On a database I have a table, with two columns, named as FileName and the FileType. On the table I define the data type as 'Text'. I try to add some data to it within my code as follows.


_RecordsetPtr pRec;
ostringstream sqlCmd;
char chState = 'R';

bool bState = true; // Type handle, cmdline
if(bState)
    chState = 'R';
else
    chState = 'T';

sqlCmd << "INSERT INTO tblGroupState(DiskFileName, FileState) VALUES(" << fileName << ", "
    << chState << ")";

try
{
    pRec = m_pConn->Execute(sqlCmd.str().c_str(), NULL, adCmdText);

    pRec->Close();
}
catch(_com_error &e)
{
    _bstr_t bstrSource(e.Source());
    _bstr_t bstrDescription(e.Description());
    printf("\n Source : %s \n Description : %s \n",(LPCSTR)bstrSource,(LPCSTR)bstrDescription);
}



Here, m_pConn is the connection to the database and it is perfectly work. Because I used it previously.

My code gives an error, Can you guys find that where I'm going wrong with.

I appreciate your help all the time...
Eranga Smile | :)

GeneralRe: Write values to a database within the C++ code Pin
Iain Clarke, Warrior Programmer16-Jan-08 0:11
Iain Clarke, Warrior Programmer16-Jan-08 0:11 
GeneralRe: Write values to a database within the C++ code Pin
CodingLover16-Jan-08 0:34
CodingLover16-Jan-08 0:34 
QuestionRe: Write values to a database within the C++ code Pin
David Crow16-Jan-08 2:43
David Crow16-Jan-08 2:43 
GeneralRe: Write values to a database within the C++ code Pin
CodingLover16-Jan-08 14:56
CodingLover16-Jan-08 14:56 
QuestionEnable/Disable Local Area Connection Pin
Vaibhav Gade15-Jan-08 23:11
Vaibhav Gade15-Jan-08 23:11 
GeneralRe: Enable/Disable Local Area Connection Pin
Iain Clarke, Warrior Programmer15-Jan-08 23:25
Iain Clarke, Warrior Programmer15-Jan-08 23:25 
GeneralRe: Enable/Disable Local Area Connection Pin
David Crow16-Jan-08 2:45
David Crow16-Jan-08 2:45 
GeneralClass View / Sourcesafe Icons Pin
Anorexic Tribble15-Jan-08 23:05
Anorexic Tribble15-Jan-08 23:05 
GeneralRe: Class View / Sourcesafe Icons Pin
Catherine Sea17-Feb-08 17:38
Catherine Sea17-Feb-08 17:38 
Generalflickering on dialog box Pin
MKUser15-Jan-08 23:02
MKUser15-Jan-08 23:02 
GeneralRe: flickering on dialog box Pin
Don Box15-Jan-08 23:21
Don Box15-Jan-08 23:21 
GeneralRe: flickering on dialog box Pin
Iain Clarke, Warrior Programmer15-Jan-08 23:36
Iain Clarke, Warrior Programmer15-Jan-08 23:36 
GeneralRe: flickering on dialog box Pin
MKUser16-Jan-08 0:21
MKUser16-Jan-08 0:21 
GeneralRe: flickering on dialog box Pin
Mark Salsbery16-Jan-08 7:19
Mark Salsbery16-Jan-08 7:19 
GeneralRe: flickering on dialog box Pin
MKUser16-Jan-08 16:40
MKUser16-Jan-08 16:40 
GeneralRe: flickering on dialog box Pin
Mark Salsbery17-Jan-08 11:07
Mark Salsbery17-Jan-08 11:07 
Questionhow can remove this error "MCIERR_INVALID_FILE" [modified] Pin
Le@rner15-Jan-08 22:15
Le@rner15-Jan-08 22:15 

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.