Welcome, I'm Chris (aka Moose) I'm an independent contractor here at Just Answer.
Sorry for the delay I was helping another customer that replied prior to you.
Does your vehicle have an aftermarket alarm, immobilizer, or remote start? If so disable them and see if that helps.
Normally an alarm that goes off immediate after opening a door means the car has sensed unauthorized entry. Like a door ajar sensor going bad. most often just inserting the key into the ignition and turning it to the run position resolves this. I assume that failed to work based on your comments. So we are left with verifying the battery voltage is good at 12.6 volts and a reset. Disconnect both battery cables, hold them together for 1 minute then reconnect. Then lock unlock the door with the key and try both keys in the ignition. If it still fails then a sophisticated diagnostic tool is needed for diagnosing and reprogramming.
Thanks for asking your question and letting me try to help you.
You should see a rating screen if I have posted an answer, not for an info request.
Your rating is my feedback. If I don't get feedback from customers, I will not be able to continue helping customers here.
Rating me good, bad, or not rating at all does not effect the fee you have paid nor does it close the post.
Follow up/Reply as many times as needed.