Results 1 to 2 of 2

Thread: Preventing the Database from Crashing when the only Record is deleted

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 1999
    Posts
    6

    Post

    How do I prevent my Program from crashing when I delete the only record in the recordset.
    Thankx in advance....

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    There are a number of ways.

    1) don't delete the last record. I have an application that tells the user they cannot delete the last record (it checks to see how many records are stored in the DB prior to deleting. If record count = 1, msgbox user)

    2) you could use the command:
    On Error resume next

    This could, however lead to spurious errors occurring until you get a record in your database.

    3) don't use bound controls. Jet and ODBC don't care if your tables are populated. You'll still need to deal with coding for empty tables, though.

    4) a modification of # 1 above, if it's the last record, delete the record you want after adding a new one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width