David died before Jesus came and was raised from the dead.
Therefore David could not go to heaven yet because the penalty for sin had not been paid.
Understand that it is faith in Christ as our Savior that saves us. Read Heb 11 to learn that saints in the Old Testament were declared righteous because of this faith.
4 By faith he was commended as righteous, when God spoke well of his offerings.
32 And what more shall I say? I do not have time to tell about Gideon, Barak, Samson and Jephthah, about
David and Samuel and the prophets, 33
who through faith conquered kingdoms, administered justice, and
gained what was promised
Jesus was chosen to be our Savior before creation. It was always in God's plan for him to die for our sins. Do you think that God's grace is bound by God's plan for the giving of grace? Do you think that the Bible that gives us hints of God's plan had to be written for us to be saved? Do you think we must understand and read of God's plan for us to be saved? Scripture has been written thousands of years after creation. Those that lived before God's plan was written down for us in the Bible are saved in the same way we now are saved, by the grace of God. One who thinks that the grace of God is somehow constrained by time does not understand that God is outside of time.
After Jesus was resurrected Ephesians tells us that Jesus led captivity captive, showing that all of the OT saints including David was taken to heaven.
I would like to see where you think scripture implies that the captives Jesus led were dead saints. Jesus himself quotes Isaiah and says captives are those living and today, the day Jesus said it, he fulfilled the prophecy.
Luke 4:18 “The Spirit of the Lord is upon me,
because he has anointed me
to proclaim good news to the poor.
He has sent me to
proclaim liberty to the captives
and recovering of sight to the blind,
to set at liberty those who are oppressed,
19 to proclaim the year of the Lord's favor.”
20 And he rolled up the scroll and gave it back to the attendant and sat down. And the eyes of all in the synagogue were fixed on him. 21 And he began to say to them, “
Today this Scripture has been fulfilled in your hearing.”
Paul in Romans 7 defines what it means to be captive: to follow the sinful nature of our flesh.
23 but I see in my members another law waging war against the law of my mind and making me
captive to the law of sin that dwells in my members.
Now for your misinterpreted Ephesians passage, Paul prefaces the scripture explaining it to referring to God's grace being a gift from God, given to us, that means those saints alive.
7 But
grace was given
to each one of
us according to the measure of
Christ's gift. 8
Therefore it says,
“When he ascended on high he led a host of captives,
and
he gave gifts to men.”