Hello, Ramani,
It doesn't work. If i do so, the new record cannot be saved since the recordset is always set as Edit mode.
Main Topics
Browse All TopicsI have a VB6.0 application with editable DBGrid and oracle
data control and some textBox. The DBGrid and textBoxs are bound to the ORADC.
I have three buttons, new, delete and save.
When i click the New button, i fill the textboxs. Then i click Save Button to save the new record.
The problem is - after i click Save button, if i want to make change to this record and click Save button again(or if i want to delete this new record), i always get this message
Run-time error '440': OIP-04119: Data has been modified.
I cannot fix this bugs and don't know what cause it, and i cannot get any information from the website. So i have to ask some experts for help.
Please help me. Thank you
Private Sub SSCommandNew_Click()
If oradcItem.EditMode = dbEditAdd Then
MsgBox "You have already Added a record without Saving.", vbInformation
Exit Sub
End If
oradcItem.Recordset.AddNew
DBGrid1.AllowAddNew = True
End Sub
Private Sub SSCommandDelete_Click()
Dim iRet As Integer
If oradcItem.EditMode = dbEditAdd Then
MsgBox "You can't Delete an Unsaved record.", vbInformation
Exit Sub
End If
With oradcItem.Recordset
If .RecordCount = 0 Then Exit Sub
iRet = MsgBox("Do you want to Delete this record?", vbYesNo, vbQuestion)
If iRet <> 6 Then Exit Sub
.Delete
.Refresh
End With
End Sub
Private Sub SSCommandUpdate_Click()
On Error GoTo Errhandler
If oradcItem.EditMode = dbEditNone Then
oradcItem.Recordset.Edit
End If
oradcItem.Recordset.Update
DBGrid1.AllowAddNew = False
Errhandler:
If Err.Number > 0 Then
MsgBox Err.Source & " " & Err.Description, vbCritical, "Error"
End If
End Sub
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hello,
OO4O does have some bugs in ver 7.2.2 and older with update problems. Try and use the dirty_write method during the CreateDynaset method. This will allow you to rewrite over previously updated info. It should look something
like the following;
Set yourOraDynaset = yourOraDatabase.CreateDyna
If you use ORADC, set the DirtyWrite property to TRUE
Add oradcItem.DirtyWrite = True to your code and it will works fine.
Private Sub mnuitmSave_Click()
On Error GoTo Errhandler
oradcItem.DirtyWrite = True
If oradcItem.EditMode = dbEditNone Then
oradcItem.Recordset.Edit
End If
oradcItem.Recordset.Update
DBGrid1.AllowAddNew = False
Errhandler:
If Err.Number > 0 Then
MsgBox Err.Source & " " & Err.Description, vbCritical, "Error"
End If
End Sub
Business Accounts
Answer for Membership
by: ramani_grPosted on 2002-05-06 at 04:17:55ID: 6991052
Could you rewrite this Sub and check.
Private Sub SSCommandUpdate_Click()
On Error GoTo Errhandler
If Not DBGrid1.DataChanged Then
oradcItem.Recordset.Edit
DBGrid1.DataChanged = True
End If
oradcItem.Recordset.Update
DBGrid1.AllowAddNew = False
Errhandler:
If Err.Number > 0 Then
MsgBox Err.Source & " " & Err.Description, vbCritical, "Error"
End If
End Sub
Good luck.