recordset.addnew

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to add a new record to an odbc data base. I am
using MS ActiveX library2.8. The syntax is recordset.AddNew
(object fieldlist, object values). Object fieldlist and
values can be one field/value or can be an array of fields
and values. My problem is I do not know how to set up the
array for this to work. I try the following: string[] fn
= new string[]={"Name_of_the_field", "Name_of_the_field"};
string[] fv=new string[] = {"Value_of_the_field",
Value_of_the_field"};
recordset.Open
(query,connection,ADODB.CursorTypeEmun.adOpenKeyset,ADODB.L
ockTypeEnum.adLockOptimistic,-1);
recordset.AddNew(fn, fv); I get the following error: Item
can not be found in colletion corresponding to the
requested name or ordinal.
 
Back
Top