Click here to Skip to main content
15,910,878 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Memory leak? Pin
Ghazi H. Wadi19-Sep-01 12:25
Ghazi H. Wadi19-Sep-01 12:25 
AnswerRe: Memory leak? Pin
Tim Smith19-Sep-01 12:32
Tim Smith19-Sep-01 12:32 
GeneralClient/Server in MFC Pin
Rickard Andersson2019-Sep-01 6:34
Rickard Andersson2019-Sep-01 6:34 
GeneralRe: Client/Server in MFC Pin
Ghazi H. Wadi19-Sep-01 12:27
Ghazi H. Wadi19-Sep-01 12:27 
GeneralADO Connection Pin
Stu19-Sep-01 6:29
Stu19-Sep-01 6:29 
GeneralRe: ADO Connection Pin
ORi x19-Sep-01 6:41
ORi x19-Sep-01 6:41 
GeneralRe: ADO Connection Pin
Stu19-Sep-01 6:50
Stu19-Sep-01 6:50 
GeneralRe: ADO Connection Pin
Michael P Butler19-Sep-01 11:11
Michael P Butler19-Sep-01 11:11 
This is the code I use to create an ADO connection, the only difference I can see is that I pass cast my empty strings to _bstr_t first.

Are you getting a compile error or a runtime error

_ConnectionPtr m_pConnection
HRESULT CAdoConnection::Connect(std::string sConnectionStr)
{
    HRESULT hr = S_OK;
    try
    {
        hr = m_pConnection.CreateInstance(__uuidof(Connection));
	if(hr == S_OK)
	{
	    hr = m_pConnection->Open(_bstr_t(sConnectionStr.data()), _bstr_t(""), _bstr_t(""), adConnectUnspecified);
	}
    }
    catch (_com_error &e)
    {
    }


    return hr;
}



Michael Smile | :)
GeneralRe: ADO Connection Pin
Stu19-Sep-01 11:28
Stu19-Sep-01 11:28 
GeneralRe: ADO Connection Pin
Michael P Butler19-Sep-01 22:21
Michael P Butler19-Sep-01 22:21 
GeneralRe: ADO Connection Pin
Stu20-Sep-01 6:03
Stu20-Sep-01 6:03 
GeneralRe: ADO Connection Pin
Carlos Antollini20-Sep-01 6:18
Carlos Antollini20-Sep-01 6:18 
QuestionHow can I scroll a CFormView? Pin
Craig Miller19-Sep-01 6:27
Craig Miller19-Sep-01 6:27 
AnswerRe: How can I scroll a CFormView? Pin
Tomasz Sowinski19-Sep-01 6:53
Tomasz Sowinski19-Sep-01 6:53 
GeneralRe: How can I scroll a CFormView? Pin
Craig Miller19-Sep-01 7:04
Craig Miller19-Sep-01 7:04 
GeneralRe: How can I scroll a CFormView? Pin
Tomasz Sowinski19-Sep-01 7:15
Tomasz Sowinski19-Sep-01 7:15 
GeneralRe: How can I scroll a CFormView? Pin
Craig Miller19-Sep-01 9:54
Craig Miller19-Sep-01 9:54 
GeneralPostMessage... philosophy... Pin
Remi Morin19-Sep-01 6:10
Remi Morin19-Sep-01 6:10 
GeneralRe: PostMessage... philosophy... Pin
Tomasz Sowinski19-Sep-01 7:05
Tomasz Sowinski19-Sep-01 7:05 
GeneralRe: PostMessage... philosophy... Pin
Remi Morin19-Sep-01 7:44
Remi Morin19-Sep-01 7:44 
GeneralRe: PostMessage... philosophy... Pin
Tomasz Sowinski19-Sep-01 8:09
Tomasz Sowinski19-Sep-01 8:09 
GeneralRe: PostMessage... philosophy... Pin
Remi Morin19-Sep-01 9:02
Remi Morin19-Sep-01 9:02 
GeneralRe: PostMessage... philosophy... Pin
Tomasz Sowinski19-Sep-01 9:15
Tomasz Sowinski19-Sep-01 9:15 
GeneralRe: PostMessage... philosophy... Pin
Remi Morin19-Sep-01 9:57
Remi Morin19-Sep-01 9:57 
GeneralRe: PostMessage... philosophy... Pin
Tomasz Sowinski19-Sep-01 10:20
Tomasz Sowinski19-Sep-01 10: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.