Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2004, 05:30 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ATL Server Web service

Hi guys,
i have an ATL Server web service written in C++ and connecting to a SQL database. I noticed the ADO objects do not hold thier state between function calls. After each call, the class member ADO objects do not exist anymore.

section of code is bellow

int InitializeADOComponents()
{
    try
    {
        HRESULT hr = m_connectionPtr.CreateInstance(__uuidof(Connection ));
        if(SUCCEEDED(hr))
        {
            hr = m_commandPtr.CreateInstance(__uuidof(Command));
            if(SUCCEEDED(hr))
            {
                hr = m_recordsetPtr.CreateInstance(__uuidof(Recordset)) ;
                if(FAILED(hr))
                {
                    retVal = -1;
                }
            }

    }
    catch(...)
    {
        retVal = 101;
    }

    return retVal;
}

int OpenDatabaseConnection()
{
    try
    {
        _bstr_t bstrConnection("Provider=sqloledb;Data Source=DSN123;"
                "Initial Catalog=Manager;User Id=test;Password=test;");

        if(m_connectionPtr)
        {
            HRESULT hr = m_connectionPtr->Open(bstrConnection,"", "",adConnectUnspecified);
            if(FAILED(hr))
            {
                bConnected = -1;
            }
        }
    }
    catch(_com_error er)
    {
        _bstr_t bs = er.Description();
        return 101;
    }

    return bConnected;
}
This (OpenDatabaseConnection() ) and other ADO method calls after InitializeADOComponents fail because the ADO objects are NULL.
example m_connectionPtr is NULL.

What can the problem be?

thanks guys
keepac





Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Service Server Requirements ashokparchuri .NET Web Services 0 January 2nd, 2007 06:26 PM
Web Service Vs. Client/Server gabrielboys .NET Web Services 10 January 10th, 2006 06:48 AM
Terra Server Web service problem lkubler BOOK: Beginning Access 2003 VBA 2 October 10th, 2005 11:37 PM
SQL server 2000 as a web service lachupacabra .NET Web Services 0 November 17th, 2003 04:45 PM
C++ Atl Web service wizard Julie Lin .NET Web Services 0 October 1st, 2003 12:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.