SQL / Crystal Reports / application mystery bug

NuclearNed

Raconteur
May 18, 2001
7,862
354
126
I have an application I wrote that has worked well for 2-3 years, but suddenly the people who are using it have a case where it is failing for unknown reasons.

The part that is failing is a Crystal Reports report that is being displayed inside a viewer that I wrote with managed C++. The first two pages of the report work fine, but attempting to display the 3rd page results in this message: "Failed to retrieve a rowset". This report works completely fine on every set of data they run it against, except for this most recent one. To deepen the mystery, this error only occurs when a normal user attempts to run the report. When I run the report under my administrator account, everything works as expected.

The page of the report in question has 3 separate SQL statements. By running a trace I know which of the 3 statements is causing the error. I can't display it on a public forum because of our company security policy, but it is a very straightforward and simple SELECT statement that calls two user-defined functions I created.

Does anybody have any ideas? If you need clarification on anything, please ask me.
 

rsd

Platinum Member
Dec 30, 2003
2,293
0
76
obviously simplistic, but did you check the permissions on those functions and/or the "normal" users accounts? Sounds like they can't access the function or db maybe? Just a thought
 

NuclearNed

Raconteur
May 18, 2001
7,862
354
126
Originally posted by: rsd
obviously simplistic, but did you check the permissions on those functions and/or the "normal" users accounts? Sounds like they can't access the function or db maybe? Just a thought

That was the first thing I thought of too, but it seems like the permissions are set correctly. Running this report on any other dataset works correctly, which means that the users must have the required permissions for the udfs.

Everything about this seems like a data problem, but I just can't figure it out, especially since the entire report seems to run correctly under an administrator account.
 

rsd

Platinum Member
Dec 30, 2003
2,293
0
76
Does the required function call any other functions/views/sp's that may have changed or had their permissions change? Does it only affect some "normal" users or all of them?
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Run Filemon and Regmon while you attempt to run the report to determine what registry keys and/or files the program is attempting to access. This is the easiest way to determine where your permissions problem lies.
 

NuclearNed

Raconteur
May 18, 2001
7,862
354
126
Originally posted by: rsd
Does the required function call any other functions/views/sp's that may have changed or had their permissions change? Does it only affect some "normal" users or all of them?

No other functions are called from within the udfs I wrote.

The bug occurs for all the "normal" users that I have checked.

One piece of info I just remembered (which may be totally unrelated). My udfs return a float, which is the end result of a calculation. The calculation has a division, so the potential for a "divide by zero" error is there. However, I have done some checking and I don't believe that this is the problem.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: rsd
Does the required function call any other functions/views/sp's that may have changed or had their permissions change? Does it only affect some "normal" users or all of them?

Another good point. Are you using integrated authentication to connect to your SQL server DB? If so, does the user in question have the necessary permissions to run your user-defined functions?
 

rsd

Platinum Member
Dec 30, 2003
2,293
0
76
Originally posted by: NuclearNed
Originally posted by: rsd
Does the required function call any other functions/views/sp's that may have changed or had their permissions change? Does it only affect some "normal" users or all of them?

No other functions are called from within the udfs I wrote.

The bug occurs for all the "normal" users that I have checked.

One piece of info I just remembered (which may be totally unrelated). My udfs return a float, which is the end result of a calculation. The calculation has a division, so the potential for a "divide by zero" error is there. However, I have done some checking and I don't believe that this is the problem.

If not a divide by zero, perhaps there is a null/empty data point that is causing an issue?
 

NuclearNed

Raconteur
May 18, 2001
7,862
354
126
Originally posted by: rsd
Originally posted by: NuclearNed
Originally posted by: rsd
Does the required function call any other functions/views/sp's that may have changed or had their permissions change? Does it only affect some "normal" users or all of them?

No other functions are called from within the udfs I wrote.

The bug occurs for all the "normal" users that I have checked.

One piece of info I just remembered (which may be totally unrelated). My udfs return a float, which is the end result of a calculation. The calculation has a division, so the potential for a "divide by zero" error is there. However, I have done some checking and I don't believe that this is the problem.

If not a divide by zero, perhaps there is a null/empty data point that is causing an issue?

Possibly. That is where my focus currently is. The only thing I keep going back to is that it works for me, which makes me think it is not a data/coding problem.