Click to See Complete Forum and Search --> : ATL: how can i use CRowset::Insert() to insert data


CoDavid
October 21st, 2005, 10:03 AM
...
CCommand<CDynamicAccessor> rs;
...
//i successfully opened the database, and displayed the data in it
//and i can use SetData() to update change, but when i use Insert()...****!

LPWSTR pwszName = (LPWSTR)rs.GetValue(1);
wcscpy(pwszName, L"uu"); //nchar(16) in ms-sql
rs.SetLength(1,16);
rs.SetStatus(1, DBSTATUS_S_OK);
rs.ReleaseRows();//if i dont use this, Insert will return DB_E_ROWSNOTRELEASE

rs.Insert();//returns DB_E_ROWSNOTRELEASE
rs.Update();returns DB_E_ERROROCCURED :(


coule anybody help me out ?? plzzzzzzzzz~~!!!

CoDavid
October 23rd, 2005, 04:51 AM
nobody nos? oooh, god

at least...could anybody tell me something about the ReleaseRows. when i call it, what happens in my system