Click here to Skip to main content
15,917,859 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCDhtmlDialog (VS.NET) Pin
Roman Nurik2-Aug-02 17:34
Roman Nurik2-Aug-02 17:34 
GeneralRe: CDhtmlDialog (VS.NET) Pin
ColinDavies2-Aug-02 21:14
ColinDavies2-Aug-02 21:14 
GeneralMDI question Pin
RK_20002-Aug-02 17:18
RK_20002-Aug-02 17:18 
GeneralRe: MDI question Pin
Pavel Klocek3-Aug-02 2:46
Pavel Klocek3-Aug-02 2:46 
QuestionSQL anyone? Pin
nss2-Aug-02 17:08
nss2-Aug-02 17:08 
AnswerRe: SQL anyone? Pin
RK_20002-Aug-02 17:15
RK_20002-Aug-02 17:15 
GeneralRe: SQL anyone? Pin
nss2-Aug-02 18:16
nss2-Aug-02 18:16 
GeneralRe: SQL anyone? Pin
RK_20002-Aug-02 18:26
RK_20002-Aug-02 18:26 
Your latest SQL statement is incorrect btw...the first one was ok.in this one you're missing your column names..You either have to go insert into x(yy,yyy,yyy) values ('','','') or insert into x select x,x,x

This usually works for me as far as inserts go. Remember that you are dealing with COM, so everything is _bstr_t..so you can't just use strings...
Here m_pConnection and varQuery are defined as

const std::string & varQuery
static _Connection * m_pConnection;

then here is my functin which receives the varQuery...BTW, for USES_CONVERSION, you need to include atlconv.h file!

BOOL CDBClass::ExecuteQuery(const std::string & szQuery)
{
USES_CONVERSION;

BOOL bRet = TRUE;
HRESULT hRes = 0;

_variant_t varQuery;
varQuery = A2W(szQuery.c_str());

if(m_pConnection == 0)
CreateConnection();

if(m_pConnection != 0)
{
try {
hRes = m_pConnection->Execute(varQuery.bstrVal, NULL, NULL, NULL);
}

catch (...)
{

bRet = FALSE;
}

if(hRes != 0)
GetError();

hRes == 0 ? bRet = 1 : bRet = 0;
}


return bRet;
}
GeneralRe: SQL anyone? Pin
nss2-Aug-02 18:25
nss2-Aug-02 18:25 
GeneralExit Problem Pin
Selevercin2-Aug-02 14:39
Selevercin2-Aug-02 14:39 
GeneralRe: Exit Problem Pin
Nish Nishant2-Aug-02 15:19
sitebuilderNish Nishant2-Aug-02 15:19 
GeneralRe: Exit Problem Pin
Selevercin2-Aug-02 16:07
Selevercin2-Aug-02 16:07 
GeneralGetAbsolutePosition Pin
ns2-Aug-02 11:55
ns2-Aug-02 11:55 
GeneralPutAbsolutePosition - got it. Thanks anyways!!! Pin
ns2-Aug-02 12:07
ns2-Aug-02 12:07 
GeneralRe: PutAbsolutePosition - acting weirdly!!Hellllllp! Pin
ns2-Aug-02 12:18
ns2-Aug-02 12:18 
GeneralAddNew() problem in Pin
ns2-Aug-02 11:46
ns2-Aug-02 11:46 
GeneralRe: AddNew() problem in Pin
ColinDavies2-Aug-02 21:38
ColinDavies2-Aug-02 21:38 
GeneralRe: AddNew() problem in Pin
ns5-Aug-02 2:14
ns5-Aug-02 2:14 
GeneralGlobal Variables Pin
Peter Liddle2-Aug-02 11:18
Peter Liddle2-Aug-02 11:18 
GeneralRe: Global Variables Pin
Anonymous2-Aug-02 11:36
Anonymous2-Aug-02 11:36 
GeneralRe: Global Variables Pin
Peter Liddle2-Aug-02 11:39
Peter Liddle2-Aug-02 11:39 
Questionrecordset doesnt support Updating ....? Pin
ns2-Aug-02 9:03
ns2-Aug-02 9:03 
Questionhow to get a pc-name form its ip-address? Pin
Aaron K.B. Huang2-Aug-02 8:54
Aaron K.B. Huang2-Aug-02 8:54 
AnswerRe: how to get a pc-name form its ip-address? Pin
shetty2-Aug-02 11:57
shetty2-Aug-02 11:57 
AnswerRe: how to get a pc-name form its ip-address? Pin
Anders Molin2-Aug-02 12:39
professionalAnders Molin2-Aug-02 12:39 

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.