Cocaine and conception

We are trying to conceive with my boyfriend but I haven’t been able to for 3 months. He told me last night that he’s afraid it might be that he had done cocaine before for a long time on a regular but also told me that he’s had other girls get pregnant by accident(before he was doing coke) .

So my question is, can cocaine in the past be the cause of it ? And if I do get pregnant, will cocaine from the past affect the baby?