Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create 1 report to access 3 databases for 3 different reports -CRXI

Status
Not open for further replies.

mgason

Technical User
Feb 6, 2003
158
AU
Hi,
Hi
I currently have a report that accesses a database newMixdata1.
Now there will be 3 databases, newMixData2, and newMixdata3.

How can I change my report so that it can go to the correct database depending on which login it is passed by VB6?
I don't want to have 3 separate reports.

My login would look like this in VB I think, where gl_Mixer = 1, 2 or 3
Code:
report1.Database.LogOnServer "p2sodbc.dll", "mixdata" & gl_Mixer, "newMixData1" & gl_Mixer, "user", "password"

the report points to newMixdata1, and fails to login if gl_mixer is 2 or 3
what are the steps in Crystal to make this work?
Is this even the best method in VB?

thanks
mark
 
To do this, you will have to implement a "push" method in your VB code. Basically, depending on the user credentials provided, you will build a DataSet object from the correct database. This is not possible in Crystal alone, but using a VB distribution of Crystal, this is definitely possible. In short:

1) Prompt users for authentication in VB
2) Depending on what authentication is passed, choose the appropriate database and build a DataSet from that database.
3) Assign this DataSet to a Crystal Report that is built to handle and of the different data sets (it sounds like they are similarly/identically structured? so this shouldn't be too problematic)

Pont
 
Hi,
thanks for the reply
can you point me to some more info on building a dataset in VB and using that in Crystal.
So I have something to show our VB people.
mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top