Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

VB4 Standard Edition

I have Vb4 Standard edition.I was able to determine from the
online help that I cannot create objects like Database, workspace, etc. I'm limited to the Data object.
When I try to assign a new value to a field :
Data1.Recordset.MoveFirst
Data1.Recordset.Fields(1)="England"
Data1.Recordset.MoveNext
I get run time error 3020  "update without Addnew or Edit"

Why can't I modify the value of the field ?(field(1) is a
text field size 25"
According to the Programmers Guide this should work. Any ideas?
0
SFreitas
Asked:
SFreitas
1 Solution
 
rmichelsCommented:
After you do your MoveFirst to establish a current record you must use Data1.Recordset.Edit.  This then allows yout to assign data to the current record.  To update the row in the data table you use the Update method....Data1.RecordSet.Update.

Data1.Recordset.Addnew will create a new record in the table.

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now