Database logon failed

good day.

i am receiving a "database logon failed" error in the code below.  the code works on my development machine; however, it fails on the clients and i cannot figure out why.  the client machines run other crystal reports with similiar code below.

any help would be appreciated.

thanks.
try
            {
                if (_header.ID > 0)
                {
                    ReportDocument rep = new ReportDocument();
                    rep.Load(System.Windows.Forms.Application.StartupPath + reportName);
 
                    TableLogOnInfo tliCurrent;
                    foreach (Table curr in rep.Database.Tables)
                    {
                        tliCurrent = curr.LogOnInfo;
                        tliCurrent.ConnectionInfo.ServerName = severName;
                        tliCurrent.ConnectionInfo.UserID = uID;
                        tliCurrent.ConnectionInfo.Password = uPWD;
                        tliCurrent.ConnectionInfo.DatabaseName = dbName;
                        curr.ApplyLogOnInfo(tliCurrent);
                    }
                    ParameterValues pvCollection = new ParameterValues();
                    ParameterDiscreteValue rmaCounter = new ParameterDiscreteValue();
                    rmaCounter.Value = _header.ID;
                    pvCollection.Add(rmaCounter);
 
                    rep.DataDefinition.ParameterFields[0].ApplyCurrentValues(pvCollection);
                    rep.PrintOptions.PrinterDuplex = PrinterDuplex.Default;
                    rep.PrintOptions.PrinterName = Properties.Settings.Default.PrinterName.ToString();
                    rep.PrintToPrinter(1, true, 1, 999);
                    rep = null;
                }
                else MessageBox.Show("Sorry, there is no current RMA record loaded.", "Data Required", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                LogWriter.LogWriter.WriteError("Error in printing RMA packing slip: " + ex.Message);
            }

Open in new window

LVL 1
freezingHotAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

freezingHotAuthor Commented:
i also tried to replace the foreach loop with a SetDatabaseLogon() command; however, that didn't fix the problem either.
mlmccCommented:
I assume the user has permissions and you are passing the correct password.

The code looks correct.

Does the report have a subreport?

mlmcc
freezingHotAuthor Commented:
yes, in fact, i even added the sa username/password just to make sure.

no, the report does not have a subreport.

thanks.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

mlmccCommented:
Are you using the CR XI R2 runtimes with the application?

mlmcc
freezingHotAuthor Commented:
i believe so - i downloaded and installed the merge modules from SP2.  in addition, other reports are working fine.  there is only one (1) report that is failing with this error code.
mlmccCommented:
Since this is the only one then the applicatiion is probably ok.

What is different about this report?

mlmcc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
freezingHotAuthor Commented:
finally found it...

the database provider was set as SQL Server Native Client - the client machines may not have had the drivers.  Changed it to OLEDB for SQL Server and it worked... thanks for steering me in the right direction.

have a good one.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.