Results 1 to 11 of 11

Thread: [RESOLVED] Delete Markred Record DBase III

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Resolved [RESOLVED] Delete Markred Record DBase III

    Hi yesterday I written a small class for VB That allows you to edit, view DBase III Files in VB At the moment most of it is working you can create a new table, Add fields, delete fileds records, support most data types like Text, Numeric, Memos and more.

    the only problem is deleting records, I mean I can mark a record to be deleted by adding the * to the first part of the record. But I need to remove the record all tougher. Any ideas or does any one have a small piece of code.

    I looked all around the net and I can;t seem to find anything what so ever.

    Thanks.
    When your dreams come true.
    On error resume pulling hair out.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    Is there any one on this forum.
    When your dreams come true.
    On error resume pulling hair out.

  3. #3
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: Delete Markred Record DBase III

    Yes, to physically delete records from a dbase III/Fox file you must PACK it. Here's an old article - it's for VB3, but you may be able to adapt it to your needs.
    http://support.microsoft.com/default...b;en-us;119116
    "It's cold gin time again ..."

    Check out my website here.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    Thanks but this is not what I am looking for. I need a way to do this tho code. not using any of the MS Database controls as my project at the moment uses none of the Data Access controls. so by adding this features it's sort of defeating the object of the project.

    Thanks anyway any other ideas or code.
    When your dreams come true.
    On error resume pulling hair out.

  5. #5
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: Delete Markred Record DBase III

    all dbms applications are using the same language which is SQL or the Structured Query Language.

    the way to do that in sql is

    delete from <Table Name> where <Field Name> like '*%';
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    I don;t need to delete this record with ADO, DAO or any of the Microsoft Data Access Controls or by using SQL or any other thid party stuff, OCX, DLL Whatever.

    I need to delete this record or should I say Pack the database so the recored marked with * in front of the record is removed. the remaining recoreds are kept.

    ok I uploaded some of the code from my project. this has a small demo showing a sort of URL book example.

    anyway You see a button on the form called delete. what this does it place a * in front of the record. and write it back to the file. But what I need is some code to find all them * and delete them records from the database file.

    see the bas file for the main database stuff

    Hope someone can help.
    Attached Files Attached Files
    Last edited by dreamvb; Feb 28th, 2006 at 02:10 AM.
    When your dreams come true.
    On error resume pulling hair out.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    bump*
    When your dreams come true.
    On error resume pulling hair out.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    Anyone else got any idea's for me on how to fix this problum I am haveing.
    When your dreams come true.
    On error resume pulling hair out.

  9. #9
    Addicted Member
    Join Date
    Jun 2002
    Location
    Brugge, Belgium
    Posts
    208

    Re: Delete Markred Record DBase III

    Hello,

    I see that you open the file and read the data. Well that's where you could 'Pack' the database.

    You can read a record and check if the first letter of the record is "*"
    If it is then skip the record and go to the next one.

    But then you file will remain the same. What you need to do is write a function similar to the open database but instead of loading the data into the fData array, write it to a temporary binary file. You can use your function GetRecord, PutRecord and such to do so.

    You would just be putting away good records. Once the new file is created you can destroy the old file using the Kill command.

    Jason

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    Killazz whould you have a example of how to do this please.
    When your dreams come true.
    On error resume pulling hair out.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Delete Markred Record DBase III

    Thanks for the help I managed to do it now.
    When your dreams come true.
    On error resume pulling hair out.

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