Solved

VB4  Standard Edition

Posted on 1997-04-22
1
193 Views
Last Modified: 2008-03-10
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
Comment
Question by:SFreitas
1 Comment
 
LVL 3

Accepted Solution

by:
rmichels earned 50 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now