I am terrible with names and just openly tell people this. Sometimes I tell them upon meeting them with a light joke about how I will likely ask their name again in 5 minutes. If I meet them again, they are then already told I am no good at this and I am hoping they aren't prone to taking it personally since it's equally applied to every name I have forgotten. Mine is so bad that I once got stumped trying to conjure the first name of someone I had known 20 years. I recalled his phone number (I was writing it down for someone else as a business referral) and then couldn't recall his name to write about the 9 digits.
I have always been this way, so I have no idea the excuse that I can recall his number that I use so seldom and trip up recalling his name. I am great with other details though as well. I will recall your face, that you have 2 kids, their approximate ages, maybe even sports or activities you mentioned that they do, that you come from this city or that, where you went to university, etc, and then have a total block on your name. I used to hate it. I am used to it now and I can't see it changing, so instead I often rely on other things I can remember to break that ice and let someone know that I do recall them from before. I can know a name and stumble trying to pull it up. That friend of 20 years, I had seen him at least once a week for twenty years, yet was at a loss for reasons I don't understand. I ended up asking the person to wait while I excused myself to call my husband and ask him the name. He laughed, but he is used to this.
For my children, I used the photo trick. When we go to parties and get togethers, I make a point to take a lot of pictures and try to get some with only one person in the photo. I then make albums with names for them, of friends and relatives we see, but not maybe often enough to make names easy. So far none of them seem to have my trouble with names and I hope they never do. I used this trick before my class reunion as well. I spent about a week daily looking at photos of people I thought I was likely to see and wanted to get the name right. In business I prepped myself like this too before any major client meetings and repeated the names I was going to have to remember. Even just saying them out loud (without a photo, just from a list) helped me to pull them up when needed. It did help me.
When all else fails I just apologize that one of my flaws is difficulty with names and I am sorry I have forgotten their name. Because I am good at other details, I often compensate by laughing about how I can recall they have a English Setter they adore, and yet the name is what I struggle with, and often it makes people laugh, and feel remembered. I have learned to make a point to focus then on what I am good at, recalling details about people, and then using that in the worst cases as a saving grace that I do remember you. People seem to be forgiving of my loss of recalling their name easier when I do recall something else about them. It makes it less likely to appear that I don't care or didn't pay attention. That is what you never want. You do not want people to think you are detached or not showing due respect when in a professional setting. At work I might even say something like, "It's so good to see you. How's that son of yours doing in hockey this year?"