Link to home
Start Free TrialLog in
Avatar of imkiosks
imkiosks

asked on

Using SetDatabaseLogon

ok,

I have a report I developed with Crystal. It is using a stored procedure from our development server and test db.
The production server is physically a different machine, geographically not at our office, and the db name is slightly different as well.

My question is: Is there a reliable way to change the server, and db from code (during runtime) so once we go live with some reports, they will still work on the other server machine with the other db?

I  Crystal article I came accross, says: "...When using the SetDatabaseLogon() method, the report must connect to the same server and database with which it was designed...."  <-- IS THIS CORRECT???

It can't be that I have to develop the report against the final server and db right from the beginning!

Am I missing something here?  Is there another approach?
Also, What do I do about the stored procedure(s) that the report is using? do they need to get "re-pointed" as well?

Our delivery is 6/14/2006 - and I only found this out now!

Thanks, Sharone
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of imkiosks
imkiosks

ASKER

Crystal 9. The lanuage for the ASP .NET application is a mix of C# and VB.NET: The web app itself is written in C#, and it uses a VB.net written dll to query the report for parameter fields (i.e. input for the stored proc), and supply the values to it.  The reason for the mix - 2 developers, one is comfortable in c#, the other in vb.net. The delivery date outweighed the C# syntax learning curve.

We have only designed 1 (out of about 8) report so far. So, changing the existing report to use the same name database has already been done. The stored procs WILL be identical. However, the machine name WILL be different.

We can't really change our development machine's name to match the production machine, because the hardware has not been purchased yet. Currently, our client is working with a test machine (we provided) in their lab. But, when they fully roll out with our solution, they will purchase another machine to be their production. They will still keep the lab machine for testing future updates.

So, you see the dilemma. We have to have these stored procs and reports working on 2 different machines. We were looking to have the connection information (i.e. machine name, user name, pwd, etc.) all configurable in the web.config file.

What do you think?
Thanks, Sharone.
I think I realized what I need to do. Using a .UDL which is defined to connect to the db via a system-level DSN I created, I can assign the .udl file to the report for the datasource.

Is that the right direction?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
janmarini,

Thanks for that!  I will try it - should it work for Stored Procs too?

I currently have a system DSN set up. The report is referencing a .udl file which uses the DSN. My code is similar to yours, and did work for a while. But then stopped working - with a Logon Failure error. I retraced my steps several times, but don't really see anything that changed. I even created a brand new project, report, and .udl file - but still the same error.

Both the DSN, and .udl file test successfully against the DB.

Any ideas?  I'm thinking of calling Crystal for support........
sir i am using oracle with same problem,
what i pass in server and database in login info portion

Sorry, I don't use udl or Oracle, but here's some info on various connection strings:  http://www.connectionstrings.com/
connectionstring dot com contains the connection strings for connecting with db not with crystal reports

any one help me