By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Problem with DB2

P: 3

I have the following problem. When I start my program (C#) I create an OleDbConnection to a DB2 and use this connection for different requests. But after about 8 minutes I get the following error: "OleDbException System.Data.OleDb.OleDbException: [DB2/6000] SQL0551N "xxx" does not have the privilege to perform operation "EXECUTE" on object "NULLID.yyy". SQLSTATE=42501". What does that mean???

Thanks for your help.

Dec 12 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 759
This message indicates that the user does not have the REFERENCES privilege. You doesn't have execute permission on the object you are using.
Dec 12 '07 #2

P: 3
But why it works in the first 8 minutes? In the first 8 minutes I also send requests and it works, after 8 minutes (the request is 100% the same) I get the error. Why???

For a work around I open a new connection for each request and close the connection after the request. But here the connection seems not to be closed really. The connection state is closed but the database says there is still a connection. After some request I get the error "Open Connection failed System.Data.OleDb.OleDbException: SQL1226N The maximum number of client connections are already started. SQLSTATE=57030". I don't unterstand this, I close each connection after the request. When I close my program then the connections are closed "really", what is the problem???

Dec 12 '07 #3

P: 3
Does nobody have an idea?

That's the way I do my requests now, but also there is the problem that for each request a new real connection is opened and not really closed. My DBA says there are x connections after x requests. How can I avoid this? How can I clear the connection to the DB really???

Expand|Select|Wrap|Line Numbers
  1. public DataTable Request()
  2. {
  3.   try
  4.   {
  5.     using (OleDbConnection connection = new OleDbConnection(Constants.DB2_CONNECTION_STRING))
  6.     {
  7.       using (OleDbDataAdapter da = new OleDbDataAdapter(request, connection))
  8.       {
  9.         using (DataTable dtResult = new DataTable())
  10.         {
  11.           da.Fill(dtResult);
  12.           return dtResult;
  13.         }
  14.       }
  15.     }
  16.   }
  17.   catch (Exception ex)
  18.   {
  19.     MessageBox.Show(ex.ToString());
  20.   }
  21.   return null;
Dec 14 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.