Avatar of Ian Bell
Ian Bell
Flag for United Kingdom of Great Britain and Northern Ireland asked on

error in Access "The search key was not found in any record"

Hi,
I am getting the following error while trying to import a csv file into Access 2016
"THE SEARCH KEY WAS NOT FOUND IN ANY RECORD"
followed by
"an error occurred trying to import file (filename) the file was not imported"
Any help appreciated
Ian
Microsoft Access

Avatar of undefined
Last Comment
Ian Bell

8/22/2022 - Mon
Norie

Ian

Do any of the field names in the CSV contain unusual characters, e.g. *,? etc.?

Or are there any with reserved words e.g. Date, Name etc.?
Ian Bell

ASKER
Hi Norie,
I changed date to days and removed a full stop (.) after a fieldname and this has had no effect.
I successfully imported a similar file even with a date field but this one proves to be a problem..
Norie

Ian

What are the field names?

Also, how exactly are you importing the file?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Ian Bell

ASKER
I am importing as a text file csv.
I chose headers has field names
please see attached
EE-Fieldnames.xlsx
Norie

Ian

I don't see anything wrong with those field names, what happens if you choose the option that the header doesn't contain field names?
Ian Bell

ASKER
same problem
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Norie

Last shot, for now, what happens if you import into an existing table with matching field names?
Jim Dettman (EE MVE)

Your problem is that "Days" starts with a space.

Jim.
Ian Bell

ASKER
I wish that were the case Jim. I had put the space in to see if that made any difference. It doesn't work with or without a space.
Excuse my ignorance as I am a novice when it comes to SQL... but what exactly is a search key ?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Norie

The fields ' UKHR_EntryID',' UKHR_HorseID',' UKHR_TrainerID',' UKHR_JockeyID',' UKHR_CourseID',' LengthsBehind',' LengthsBehindTotal' and ' Duration' also have a space at the start.:)
Jim Dettman (EE MVE)

LOL....I stopped with Days as soon as I found it.  I guess I should have looked further.

<<Excuse my ignorance as I am a novice when it comes to SQL... but what exactly is a search key ?>>

 That's not part of SQL, but rather just something you'd do with a DB in general.   Access is saying it has a key it needs to look for and can't, which shouldn't happen.

Jim.
Ian Bell

ASKER
All spaces were removed and I was able to import header only but when I went to saved imports and tried to append data it asked if I wanted to overwrite existing file etc. then a series of error messages then I gave up.
I don't wish to continue with this approach as I've spent two days trying all kinds of things and cannot afford to spend another minute on it.
Life is too short. I wish to thank you all for your generous support, and will probably stick to Excel on this occasion.
Ian
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Ian Bell

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question