Examine the sample sentence in the graphic at left. The sentence really should appear as shown below. Credit with having is always used, not credit as having.
This rule makes lots of sense when you think about it. What does it mean to credit? In the context of the phrase in question, credit means a commendation or honor bestowed for some action or quality. The preposition as simply doesn’t match that definition. But the preposition with does. As connotes a connection of similarity. With connotes a connection of equality, if not in substance than certainly in position.
So always credit with having, not as having. Then you can credit yourself with having one more grammar rule conquered and being a better writer (if only a little bit).