The search key was not found in any record in Access

Well, I got this error message today while I was trying to import a text file:

“The search key was not found in any record”

After some research, I found that either it was a bug caused by Microsoft Jet 4.0 Service Pack or it was the size of the database (should be not greater than 2GB). It turned out to be the later one. I fixed this problem by compacting and resizing the database. In Access 2007, you click on the Office Button (Top Left Corner), then Manage > Compact and Repair Database.

About the Author

A co-author of Data Science for Fundraising, an award winning keynote speaker, Ashutosh R. Nandeshwar is one of the few analytics professionals in the higher education industry who has developed analytical solutions for all stages of the student life cycle (from recruitment to giving). He enjoys speaking about the power of data, as well as ranting about data professionals who chase after “interesting” things. He earned his PhD/MS from West Virginia University and his BEng from Nagpur University, all in industrial engineering. Currently, he is leading the data science, reporting, and prospect development efforts at the University of Southern California.

  • Irene says:

    For a year i have been wondering how to resolve this error until today after reading your blog.

    Thank you a million!

  • a7n9 says:

    Irene, I am glad to hear that.

  • Carla says:

    thanks! this error has been a problem

  • Sean says:

    I got the same problem but it was not to do with the Jet SP. I had leading spaces in column headers which I removed and was able to import.

  • clement says:

    Thanks man. Sometimes these microsoft operation system and applications come very close to driving me insane. Your recommending works well. It would be good if Microsoft help was more interactive and usefull. I’ve lost a day or more with this problem. cheers for being a saviour

  • a7n9 says:

    Not a problem, clement. I am glad that these solutions helped you.

  • Val says:

    For me is not working I try your suggestion still not working…
    Made all different attepmts not work….

  • Adam says:

    Thanks, really helped.

    They should make the error message more useful, though. Something like “Hey, your database is too big.”

  • Jordi says:

    Thanks from my side too,
    Error message was really insane!

  • NELLY says:

    Hi i’m was looking for this solution for an emergencyy with a database in my job THANKSSSSS

  • Karo says:

    I have not be able to fix this problem, I have been trying to split my database, and come with this error, am using Access 2007. Note that I am using Office 2007 with SP2.

  • jose alberto says:

    Wonderful!!! i had benn fighting with this problem the last year.
    Thanks man you have solved one of the more famous problem leading with data base.
    Im not used to write something in this kind of blog,s but in this case… amazing
    I never thought that the solution were so easy.

  • jasbir says:

    nice, thanks

  • bob mac says:

    Thanks! I had a leading space in a column header as well.

  • Mo says:

    Thanks. I have been dealing with with problems for over a year and it was solved by this post. Thanks again.

  • David Lindsey says:

    Thanks all! After reading here, compacting the database allowed me to run a Make Table query that was previously showing the same cryptic error message. I was working with 1,269,183 records. In terms of bad error messages: Programmers, can’t live with ’em, can’t live without ’em!

  • Ralph G.C. says:

    Thanks, this is very informative forum. It really help me alot with with this problem.

  • navvi25 says:

    Worked for me. For a long time, I was trying to figure out how to resolve this issue.
    thanks a bunch!!!.

  • Michael says:

    Thanks! The Compact DB worked perfectly. Classis Microsoft white-tower programmer nonsense. I wonder how many thousans of man-hours it would save to say either:
    “Column Headings need to be trimmed” OR
    “Please compact your database first (top left > Manage Database)”


    Thanks for the heads-up here though.

  • Bharathi says:

    Error msgs need to be more Meaningful…thats for MICROSOFT…Hey thanks a lot for the solution!!!

  • Wendy Naples says:

    Thank you!

  • Manuel says:

    If compacting the Database does not work and u are getting this msg trying to import a csv file, just be sure the source file has no empty titles.

  • W. McNabb says:

    I truly wish that the developers would right a little better descriptive error codes. Your tip was a true life saver…

    Thank you very much!


  • William says:

    An error occured
    We won’t tell you where or why
    Lazy Programmers

  • Kevin says:

    I am having the search key error also. No leading spaces, Have compacted and repaired a few time.

    How many characters can be in a heading.

  • Kathryn says:

    Like Sean I also had leading spaces in two of the column headers in my original Excel file. Once I deleted these, the file imported.

  • Regina says:

    I have to say a7n9…I greatly appreciate your post. It saved me on today! Its working like a charm now!!!! Thanks

  • Tricia says:

    Yay! Add me to the list of satisfied readers! I got this error when trying to delete one specific record from a table. ‘Compact & repair’ fixed it!

  • Diana says:

    I get the same message “The search key was not found in any record” when importing a text file into Access 2003. I tried compacting the database, removing leading spaces from header record and the problem still occurs. Can anyone help.

  • admin says:

    Diana, I’m sorry you are still facing the same problem. Let’s see if anybody else has any solution. I’ll keep searching too.

  • Julie says:

    Thanks for this – I’ve looked at loads of sites this morning trying to find out what this error means, and this one is the only one I’ve found with an actual suggestion of how it may be fixed! I’m compacting/repairing right now… fingers crossed!

  • Chris says:

    My issue was resolved when I refreshed my links to my split database. Error gone!

  • Mattias says:

    Refreshing the linked tables did the trick for me.

  • Ivey says:

    Compact & Repair Database resolved the issue for me. The “search key not found” appeared when I attempted to import Excel and text files of 150k+ lines (23,770kb). Once I ran the C&R, my files loaded with no problem.
    Thanks for your assistance.

  • >