Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Unanswered: SQLSTATE=42501 Error

    Hi everyone,

    Now I got the SQLSTATE=42501 error telling me that user "USER_A" does not have the privilege to perform operation "SELECT" on object "SCHEMA.TABLE".
    That means I don't have the prilivege. But actually my DBA already granted all the privileges I needed. One strange thing is, my application is composed of two services and a web console, and alll of them are using the same database account and password for DB accessing, and that error I mentioned is only arising in one service and the web console. At the same time, one service is running seamlessly using that same username and password having no problem. Can you help me to share any idea?
    I'm using DB2 9, and from my code, I run select statement using C# and then put the data in DataSet. And then, I check the datatype of the columns and they are allowing NULL or not.
    One thing I nearly forgot to mention is that application is working fine in TESTING_LEVEL_A server. But now in another server, it's having problem?

    All your help or any idea sharing is really appreciated.

    Thanks in advance & regards,
    Zaw Min Tun

  2. #2
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Quote Originally Posted by zawmintun View Post
    my DBA already granted all the privileges I needed.
    When dit your DBA do this?

    Quote Originally Posted by zawmintun View Post
    using the same database account and password for DB accessing, and that error I mentioned is only arising in one service and the web console
    Did you stop/start the service after the DBA granted the privileges? You need to logoff and logon again to activate the changes.

  3. #3
    Join Date
    Mar 2010
    Posts
    2

    Thanks

    Now it's working.
    But still I'm confusing until I hear from you.
    Thanks a lot for the information in your thread.

    I'm using Remote Desktop.
    I create the tables, and after just that (not logging out) I'm testing the application right away. The problem came up.
    I found the source but couldn't. I submit this post and shut down my laptop.
    Then my mind changed, open my laptop again, and log into those Remote Desktop again and then I check very very thoroughly the config files again.
    Then I found out everything is working fine.
    It really made me confuse, why the problem solved. Did I make any copy-paste mistake in config files? The time (office hour is over, so not much users anymore) is having any effect on my application? Will it be OK in normal office hours?
    I'm confusing.
    But your reply is really informational, I can say it's because I'm logging off and in again.
    Thanks a greate deal.
    Zaw Min Tun

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •