Error 524 and 3008 - records in use errors? 
Author Message
 Error 524 and 3008 - records in use errors?

Hello all -  I have a .dbf file that I'm trying to connect to via the Data
Form Wizard in VB5.  The form is created and I can see all of the records in
the .dbf file, but cannot edit, add or delete the records.  I get error 524
if I add and error 3008 if I try and delete.  Both errors state that "the
record is opened exclusively by another user or the program interface and
cannot be manipulated programmatically."  Can anyone tell me what I'm doing
wrong?  Thanks!

The code from the wizard is below
- - - -  - - - - -  -- - - -  -   - -- - - -- -  - - - -  - - - - - - - -
- -

Private Sub cmdAdd_Click()
  datPrimaryRS.Recordset.AddNew
End Sub

Private Sub cmdDelete_Click()
  With datPrimaryRS.Recordset
    .Delete
    .MoveNext
    If .EOF Then .MoveLast
  End With
End Sub

Private Sub cmdRefresh_Click()
  'This is only needed for multi user apps
  datPrimaryRS.Refresh
End Sub

Private Sub cmdUpdate_Click()
  datPrimaryRS.UpdateRecord
  datPrimaryRS.Recordset.Bookmark = datPrimaryRS.Recordset.LastModified
End Sub

Private Sub cmdClose_Click()
  Screen.MousePointer = vbDefault
  Unload Me
End Sub

Private Sub datPrimaryRS_Error(DataErr As Integer, Response As Integer)
  'This is where you would put error handling code
  'If you want to ignore errors, comment out the next line
  'If you want to trap them, add code here to handle them
  MsgBox "Data error event hit err:" & Error$(DataErr)
  Response = 0  'Throw away the error
End Sub

Private Sub datPrimaryRS_Reposition()
  Screen.MousePointer = vbDefault
  On Error Resume Next
  'This will display the current record position for dynasets and snapshots
  datPrimaryRS.Caption = "Record: " &
(datPrimaryRS.Recordset.AbsolutePosition + 1)
End Sub

Private Sub datPrimaryRS_Validate(Action As Integer, Save As Integer)
  'This is where you put validation code
  'This event gets called when the following actions occur
  Select Case Action
    Case vbDataActionMoveFirst
    Case vbDataActionMovePrevious
    Case vbDataActionMoveNext
    Case vbDataActionMoveLast
    Case vbDataActionAddNew
    Case vbDataActionUpdate
    Case vbDataActionDelete
    Case vbDataActionFind
    Case vbDataActionBookmark
    Case vbDataActionClose
      Screen.MousePointer = vbDefault
  End Select
  Screen.MousePointer = vbHourglass
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Screen.MousePointer = vbDefault
End Sub



Sun, 14 Oct 2001 03:00:00 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. Error 524 and 3008 - Record in use errors?

2. recordsets (type "table"): error 3008

3. recordsets (type "table"): error 3008

4. Run Time Error 3008

5. Run-time error '524': This action was cancelled by an associated object

6. Error 524

7. Error '524', VB4 (16 bit)

8. Error '524' VB4(16 Bit)

9. locking big trouble with VB4 (524 Error)

10. Run time error 524 - empty field

11. Runtime error 524

12. VB4.0 Run-time error '524'.


 
Powered by phpBB® Forum Software