.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top