Hi Chew Chee,
Just looking at what you have provided, I would say that it is probably not that the user do not have the rights to access the AF Database. But instead the user is unable to connect to the server because of authentication error. I would double check the credentials that you are passing in the connect method, just to be sure that it is not causing the problem
Thanks Han. It turns out that I put the wrong password in.. Grrr....