Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linked Dbase file - search key error (2003)

    I am trying to extract data from a Dbase IV application and copy it into an Access mdb. Mostly this works OK but I have had trouble with two of the DBF files. Each time I try to run queries against them I am presented with the following error: 'The search key was not found in any record' and the query fails.
    This happens even if the query does not have a where clause, even if it is something simple like a make table query that selects all the records. I saw some odd looking records in one of the files/tables which I took to be corrupt. Access wouldn't delete them but I found a utility on the web that did (DBF Viewer 2000) and that file/table now behaves as expected. However, the other file, which gives the same error message, still refuses to cooperate. I can't find any corrupt records in it, although, with 600,000+ records I may well have missed something. The original Dbase IV app, which is still being used, is over 15 years old and the developer has disappeared into the mist, so I am getting no help there.

    Unless there's an Access way around this, does anybody know of another utility out there that can repair damaged dbase IV files? It would probably have to be able to recreate the index files as well. I would also prefer it to be free, as I only expect to ever use it once.

    Yours hopefully

    Ian

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Linked Dbase file - search key error (2003)

    I started a response suggesting you use Excel, but that looks like a bad idea if you have over 600K records. Is it possible that the IDX file is corrupt? Presuming it has one or more index files, you might try copying the problem table to a folder where no IDX files exist and see if that will let you get at the data.
    Wendell

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked Dbase file - search key error (2003)

    Although DBF Viewer 2000 doesn't seem to have a way of creating indexes, it does provide a Save As function. I used this to save the problem file to another DBF file with a different name, thinking that it might only copy accross good records. The new table has the same problems.

    Ian

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Linked Dbase file - search key error (2003)

    Can you link to the table and then scroll through it. If so, you might try doing an export to a delimited text file, and then reimport the text file as a new table.
    Wendell

  5. #5
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked Dbase file - search key error (2003)

    I can 'export' the linked table as a text file. What I would like to do now is get it into another mdb file as a table. Is there a way of getting one access database (the one that I am writing all the code in) to import a text file, but into a different mdb?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked Dbase file - search key error (2003)

    You could use Automation to open a second instance of Access, open the other database in it and import the text file. See Wendell's Automation 101 for an introduction to Automation.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Linked Dbase file - search key error (2003)

    What's the point of doing this if it's just a one off?

    Are you wanting to get the text file into the backend database where all your tables are?

Posting Permissions

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