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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically changing databases through VB code 1

Status
Not open for further replies.

screeley

Programmer
Jan 8, 2001
1
US
I am trying to be able to dynamically (on the fly) change databases for reports through VB code. I have built some canned reports that will access a database file such as access. The table in access will always be the same table called FINAL, that the report is built from. As an example I might have 4 databases each for a different company and each have table FINAL. Now I want my application to be able to switch between any of the 4 databases without having to create or update any new reports (utilize the original canned reports)...Since the table name is always FINAL and will always have the same structure for each company I thought this would be possible, the only thing that changes for the canned reports would be the actual database file. so it would have to be able to do this on the fly through my VB application. Is this possible???
 
what version of CR are you using, and how are you using it (.OCX, RDC, API calls) ?
Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
The Crystal Report VCL have a facility to change the table location. For instance, Crystal VCL for Delphi has a file CRDynamic(which has declarations), which has a structure "PETableLocation" to set the table location. I believe similar facility must be there in VB.
 
you still didnt answer the question. In VB there are 3 ways to work with crystal reports:
1) .OCX(draw the CR control on a form)
2) RDC(New in CR 8, add a designer to your project. You can modify the report in design view just like you would in Crystal)
3) API calls to the reporting engine(No objects visually added to your project, define a variable for the report engine and use ApplicationProgrammingInterface calls to work with it) Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
When using PESetTableLocation what should the connectbuffer be for connecting to a MS SQL Server database through an ODBC connection? So far I have
'DSN=DatabaseName;;User ID=UserID;;Password=Password;;Database=;;UseDSNProperties=0'

It is currently working when I use a local version of an MS SQL database running on my machine - still connected through an ODBC but does not set the location correctly when I connect to a DB on a server.

Any suggestions?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top