Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
atl ole db consumer
|
|||
|---|---|---|---|
|
#18+
Добрый день всем! Подскажите пожалуйста (или дайте ссылку) как работать с классом atl ole db consumer,т.е. читать и модифицировать наборы данных? Я вставил такой класс: [ // #error Security Issue: The connection string may contain a password // The connection string below may contain plain text passwords and/or // other sensitive information. Please remove the #error after reviewing // the connection string for any security related issues. You may want to // store the password in some other form or use a different user authentication. db_source(L"Provider=MSDASQL.1;Persist Security Info=False;Data Source=lena;Extended Properties=\"DSN=mydsn\""), db_table(L"DBA.testgr") ] class CDBAtestgr1 { public: [ db_column(1, status=m_dwxStatus, length=m_dwxLength) ] double m_x; [ db_column(2, status=m_dwyStatus, length=m_dwyLength) ] double m_y; // The following wizard-generated data members contain status // values for the corresponding fields. You // can use these values to hold NULL values that the database // returns or to hold error information when the compiler returns // errors. See Field Status Data Members in Wizard-Generated // Accessors in the Visual C++ documentation for more information // on using these fields. // NOTE: You must initialize these fields before setting/inserting data! DBSTATUS m_dwxStatus; DBSTATUS m_dwyStatus; // The following wizard-generated data members contain length // values for the corresponding fields. // NOTE: For variable-length columns, you must initialize these // fields before setting/inserting data! DBLENGTH m_dwxLength; DBLENGTH m_dwyLength; 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); } }; Затем пытаюсь сделать так ... ... ... HRESULT hr; CoInitialize(NULL); CDBAtestgr1 aaa; if(SUCCEEDED(aaa.OpenDataSource())) { CDBPropSet propset(DBPROPSET_ROWSET); CDBAtestgr1 bbb; bbb.GetRowsetProperties(&propset); bbb.m_x=5; bbb.m_y=6; hr=bbb.Insert(); hr=bbb.Update (); } CoUninitialize(); ... ... ... На строке hr=bbb.Insert() выдаётся ошибка E_NOINTERFACE. Заранее большое спасибо!!! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.11.2004, 08:04 |
|
||
|
|

start [/forum/topic.php?fid=16&fpage=213&tid=1348087]: |
0ms |
get settings: |
8ms |
get forum list: |
10ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
72ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
47ms |
get tp. blocked users: |
1ms |
| others: | 221ms |
| total: | 373ms |

| 0 / 0 |
