.what is wrong with this code

S

Sanjay

Hi All

I am trying to add a new record to table through ADO and
the following code runs fine except that there is no
record added to table (DAO version does add a record). I
would appreciate if somebody could tell why it fails to
add record even if htere is no error message

Dim rst as new ADODB.recordset
rst.Open "MyTable",Currentproject.activeconnection,
adOpenKeySet, adLockOptimistic
with rst
.Addnew
.Fields("Myfield") = me.txtbox
'and so on
.Update
end with
msgbox " Data Added successfully
End sub


Every time i run this code msgbox says data added
successfully. but if you goto table there is no data
if i generate recordset via DAO it works fine but i am
converting my application to ADO

Thanks in advance

Sanjay
 
Top