Honda Accord Randomly Shuts off

Hi, I have a Honda Accord LX, 1999 with 171,000 miles. It randomly shuts off while driving. I’ve replaced the distributor cap, spark plug and wires and the problem is still occuring. any help?

Two prime suspects: the PGM-FI (Main) relay, and the distributor (sensors, and/or coil, and/or ICM (Ignition Control Module) inside the distributor). It’s simpler to replace the entire distributor, if needed, after you have replaced the PGM-FI Relay.