Re: ADO 'AddNew' fails to add first record.



Bob Barrows [MVP] wrote:
ADODB::_RecordsetPtr pRecordset;
TESTHR(pRecordset.CreateInstance(__uuidof(ADODB::Recordset)));
pRecordset->Open(TABLE_NAME, _variant_t((IDispatch
*)pConn,true),ADODB::adOpenKeyset, ADODB::adLockOptimistic,
ADODB::adCmdTable);

This is the only potential problem I see: I believe that adOpenKeyset
and adCmdTable are mutually exclusive.

Actually, i'm not sure of this statement. You should check the value of the
CursorType property after opening the recordset (at runtime) to see what it
is

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages