Commit d106b3c4 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msado15: Implement _Recordset get_EditMode.

parent a34669b2
......@@ -48,6 +48,7 @@ struct recordset
CursorLocationEnum cursor_location;
CursorTypeEnum cursor_type;
IRowset *row_set;
EditModeEnum editmode;
};
struct fields
......@@ -1575,8 +1576,14 @@ static HRESULT WINAPI recordset_put_AbsolutePage( _Recordset *iface, PositionEnu
static HRESULT WINAPI recordset_get_EditMode( _Recordset *iface, EditModeEnum *mode )
{
FIXME( "%p, %p\n", iface, mode );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %p\n", iface, mode );
if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
if (recordset->index < 0) return MAKE_ADO_HRESULT( adErrNoCurrentRecord );
*mode = recordset->editmode;
return S_OK;
}
static HRESULT WINAPI recordset_get_Filter( _Recordset *iface, VARIANT *criteria )
......@@ -2123,6 +2130,7 @@ HRESULT Recordset_create( void **obj )
recordset->cursor_location = adUseServer;
recordset->cursor_type = adOpenForwardOnly;
recordset->row_set = NULL;
recordset->editmode = adEditNone;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );
......
......@@ -60,6 +60,7 @@ static void test_Recordset(void)
BSTR name;
HRESULT hr;
VARIANT bookmark;
EditModeEnum editmode;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
ok( hr == S_OK, "got %08lx\n", hr );
......@@ -110,6 +111,10 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08lx\n", hr );
ok( cursor == adOpenForwardOnly, "got %d\n", cursor );
editmode = -1;
hr = _Recordset_get_EditMode( recordset, &editmode );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08lx\n", hr );
VariantInit( &bookmark );
hr = _Recordset_get_Bookmark( recordset, &bookmark );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08lx\n", hr );
......@@ -197,6 +202,10 @@ static void test_Recordset(void)
ok( is_eof( recordset ), "not eof\n" );
ok( is_bof( recordset ), "not bof\n" );
editmode = -1;
hr = _Recordset_get_EditMode( recordset, &editmode );
ok( hr == MAKE_ADO_HRESULT( adErrNoCurrentRecord ), "got %08lx\n", hr );
hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified );
ok( hr == MAKE_ADO_HRESULT( adErrObjectOpen ), "got %08lx\n", hr );
......@@ -223,6 +232,11 @@ static void test_Recordset(void)
ok( !is_eof( recordset ), "eof\n" );
ok( !is_bof( recordset ), "bof\n" );
editmode = -1;
hr = _Recordset_get_EditMode( recordset, &editmode );
ok( hr == S_OK, "got %08lx\n", hr );
todo_wine ok( editmode == adEditAdd, "got %d\n", editmode );
rec_count = -1;
hr = _Recordset_get_RecordCount( recordset, &rec_count );
ok( hr == S_OK, "got %08lx\n", hr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment