Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
That's my fields in accessors:
CSS
public:
    LONG m_ProductId;
    TCHAR m_ProductName[51];
    TCHAR m_Company[51];
    TCHAR m_Code[51];
    LONG m_Quantity;
    double m_Price;
    TCHAR m_Description[8000];
    DBSTATUS m_dwProductIdStatus;
    DBSTATUS m_dwProductNameStatus;
    DBSTATUS m_dwCompanyStatus;
    DBSTATUS m_dwCodeStatus;
    DBSTATUS m_dwQuantityStatus;
    DBSTATUS m_dwPriceStatus;
    DBSTATUS m_dwDescriptionStatus;
    DBLENGTH m_dwProductIdLength;
    DBLENGTH m_dwProductNameLength;
    DBLENGTH m_dwCompanyLength;
    DBLENGTH m_dwCodeLength;
    DBLENGTH m_dwQuantityLength;
    DBLENGTH m_dwPriceLength;
    DBLENGTH m_dwDescriptionLength;

That's my macroses that binded to fields:
VB
BEGIN_COLUMN_MAP(CProductsStandartAccessor)
COLUMN_ENTRY_LENGTH_STATUS(1, m_ProductId, m_dwProductIdLength, m_dwProductIdStatus)
COLUMN_ENTRY_LENGTH_STATUS(2, m_ProductName, m_dwProductNameLength, m_dwProductNameStatus)
COLUMN_ENTRY_LENGTH_STATUS(3, m_Company, m_dwCompanyLength, m_dwCompanyStatus)
COLUMN_ENTRY_LENGTH_STATUS(4, m_Code, m_dwCodeLength, m_dwCodeStatus)
COLUMN_ENTRY_LENGTH_STATUS(5, m_Quantity, m_dwQuantityLength, m_dwQuantityStatus)
COLUMN_ENTRY_LENGTH_STATUS(6, m_Price, m_dwPriceLength, m_dwPriceStatus)
COLUMN_ENTRY_LENGTH_STATUS(7, m_Description, m_dwDescriptionLength, m_dwDescriptionStatus)
END_COLUMN_MAP()

That's a method GetRowsetProperties and Define command:
C++
void GetRowsetProperties(CDBPropSet* pPropSet)
       {
           pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
           pPropSet->AddProperty(DBPROP_CANSCROLLBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
           pPropSet->AddProperty(DBPROP_IRowsetChange, true, DBPROPOPTIONS_OPTIONAL);
           pPropSet->AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE);
       }
       DEFINE_COMMAND_EX(CProductsStandartAccessor, L" \
                                                    SELECT \
                                                    ProductId, \
                                                    ProductName, \
                                                    Company, \
                                                    Code, \
                                                    Quantity, \
                                                    Price, \
                                                    Description \
                                                    FROM dbo.Products")

I'm getting error E_NOINTERFACE when try to do Insert() or Delete().I added properties DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE and I don't know what calling this warning
Posted
Comments
chandanadhikari 26-Oct-12 15:26pm    
hi,
generally E_NOINTERFACE errors come up when the interface is not registered in the system. Search in the registry of the machine if the interfaces you are trying to call are there or not.
thomas_wingfield 27-Oct-12 5:38am    
but which interfaces I have to call, chandanadhikari?I never heard about some interfaces in registry of the machine which call in programm.
Before when I saw your message I thought about that my method GetRowsetProperties not calling, I guess this trouble.
I tried to call GetRowsetProperty in Application programm, but I can't find OpenRowset property in this type (CCommand<caccessor<cproductaccessor>)...
If u think my think is wrong about GEtRowsetProperties probably can u explain about interface of the machine)
Thak you for helping.
chandanadhikari 28-Oct-12 3:52am    
hi,
I do not have any knowledge about OLE DB .I just wanted to suggest that E_NOINTERFCAE is an error related to COM. It happens when you query for an interface which is not there in the system or not recognised by the system. The registry has the information about the interfaces registered with the system .What happens is that you will be build your application but when it is executed, windows will look for the interface in which the functions (you used in the code) are defined.When the interface is not found then HRESULT is returned as E_NOINTERFACE.

You can find more info here:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms691424(v=vs.85).aspx
more about E_NOINTERFACE at:
http://msdn.microsoft.com/en-us/library/bb166327(v=vs.80).aspx
I can not tell you what is exactly wrong with the Insert or Delete operations but just trying to help you mate .
thomas_wingfield 28-Oct-12 6:20am    
Look I have CProductAccessor accessor like you see above, I'm creating object CCommand<caccessor<cproductaccessor>>.With method Open(session, sqlQuery) I get all information from table. When I try to call Insert() or Delete() I gotting this error
E_NOINTERFACE.Connection string of data source and session created good(I check it by HRESULT, Open returns S_OK too).I guess something wrong with GetRowsetProperties, It's not calling and this (DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE) not initialized that's why I can't Delete, Insert etc.
I don't know how cal this method from app progrmm by handle.
thomas_wingfield 28-Oct-12 6:38am    
http://msdn.microsoft.com/en-us/library/fk4h509a(v=vs.80).aspx
I used it like base knowladge

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900