In some cases even with a code, you need to go into your router and allow access to a device. It would be worth checking out. You will need to know the physical mac address of you computer. if you open command prompt type ipconfig /all
i believe first you have to clean the specific ssid profile(from your pc) and then try to connect. then you have to be sure that you wifi router encryption is compatible with your wifi card.last and important reboot your router!!!
you may also check if mac filtering is enabled(on router) if yes try to disable it.