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

changing database connection path!!

Status
Not open for further replies.

kingz2000

Programmer
May 28, 2002
304
DE
Hi again,
If I change the database link, and the new link has the same table and columns, how can I avoid having to edit my report all over again?? I merely want it to get the info from a different source, but I don't understand why I have to do my whole detail section and all parts relevant to the tables new!!!??
It gives me so much work everytime I need to change the database whereabouts.
Thanks for any advice.
Kingsley
 
Hi,

You can change the database from the option Database>Set Datasource Location

you will have two levels

1) Database

2) Tables

all you need to do is create a new connection from there and then simply change the database

Mo
 
yes, but the problem is tat although the new link will have the same tables and columns, I am expected to fill the report again. The place where all the fields are to be presented must be restated. As far as I'm concerned, its unnecessary work. Is it possible to avoid this?
 
This is a 5 second job. Do what MisterMo suggested.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Providing that all the tables and fields on the databases are the same the instruction above will do the trick.

it does not matter which server the datbases resides

it does not matter which name the databses have just remap one withthe other and that's it....

Mo
 
we have two compnies database under same sql server. Though I have created new data connection and in crystal report, it is showing name of new data connection as current database i.e test database, which have transactions up to dec'2005 but my report is still picking up transactions from live compnay which are current relating to january2006. what else I need to do to pull record from test database

-swabunn
 
The process is as described on my first replay, you could try a verify database and refresh the report making sure that the option "Save Data With Report" is unchecked.

if both databases are on the same server you also need to create a new connection mapping to the other database

if you are using favourites then rename the first connection before creating the new one

Mo
 
As you have recommended above. I have set up new connection to test database. current connection shows new connection i.e. test database. I have also unchecked "save data with report" in both file -> options and report options. I am not using favourites for this report. Despite this I am still getting transactions from live company where this report was originally made.

Am I missing any other step please help. I need to give report from this database to auditors

Thanks

-swabunn

 
Are you sure the data on the two databases is different.

Are you using subreports, if so they need remapping as well.





Mo
 
yes it is diffrent because if I have checked through query. and I am not using sub report in this report

-swabunn
 
I'm sorry but I think you're missing something along the way, could you explain the process you are following step by step.

on the set datasource panel you have the option to view properties for every level of the connection eg. database, tables

click on the plus sign and have a look there, the "Initial Catalog" should be different anytime you change connection.





Mo
 
Thanks for your reply, it worked. I was just updating database name and not updating tables of the report

Thanks a lot

swabunn
 
I'm having a similar issue. In the 'Set Datasource Location' screen do you have to update both the database and each individual table used in the report? I was thinking by udating the location from 'Live' to 'Test' all of the tables used in the report would also be updated.

Just a pain to do each table individually for a complex report.
 
That would be correct if you change at the highest level, all the tabls will be automatically re-mapped

If you have SubReports you will have to perform the mapping for every one of them.


-Mo
 
MisterMo,

I thought that all tables would automatically re-map as you are saying, but they do not.

I update the report to use the 'Live' database in the "Replace With" list instead of the 'Test' database currently selected for the report, but the results do not change. The data on the report only changes when I update each table in the report to the 'Live' database tables.

I do update the subreport and I do NOT have 'save data with report' selected.

Thanks,
 
Hi,
Each table in a report and subreport needs to be 'pointed'/mapped to its matching table in the new datasource - Also be aware that the table name from the original datasource is kept as the name of the table in the report( it is an alias, so that you do not need to update formulas, field names, etc)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The way datasource update works for me on a local Access database is different than how it works when connecting to SQL Server. In both cases I have the identical database in two locations, just one named "Live" and one named "Test".

On the local Access database all tables are updated to the new source automatically when choosing to update to each database, ("Live" vs. Test") When connected to SQL Server I must update each individual table in addition to the database itself.

Why the different behavior? Is there a difference between how Crystal behaves with the different database connections, (Access vs. ODBC to SQL Server), or is Crystal Reports or SQL Server not setup correctly?

Thanks,

Jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top