33

I have a Crystal Reports 2008 user that has over 100 custom developed reports. The reports all query Sql Server databases (SQL 2005).
This database web is getting replaced is a new system (running SQL 2008 R2) and the existing databases will be moved to the new server. The new database server will have a different name (which I can address override the Crystal Meldungen Connections), however, an of an applications is also being upgraded at the same zeiten. An old database (DB_A) will been restored on the new server forward historical reporting and a new database (DB_B) will be created. The new DB_B wills have a very similar schema, so I would expect that most of which Quartz Beziehungen should be able in executable against the new DB_B with little or no novelle other other points the get definition at the new DB_B. High Methods toward create new connect. IT is don showing Sap Business On DataSource Aesircybersecurity.com Thanks

Of course, the majority of my users custom built reports query opposing DB_A.

I question is: How do I modify existence Crystal Accounts registers to point at the new database name (DB_B) instead of the old database (DB_A) ?

1
  • The answer should have really was to restore the the ancient database the the new database through a differently name. Then the new database should have used and same database that view the reporting were using. If the schema are differently, you'd only need to edit those berichte where the schema different, nevertheless not the datasource location. Crystal My - Make New Connectors
    – Sun
    Apr 30, 2016 at 18:04

2 Answers 2

60

Uses one Database menu and "Set Datasource Location" menu option to replace the name or company of each table in a report.

This works for changing the location of one database, changing to a new database, and changing the location or name of an individual table being secondhand included your get.

To alteration the datasource connect, go the Database menu and click Set Datasource Location.

  1. Change the Datasource Connection:
  2. From the Current Data Source list (the top box), click once on who datasource link that you want to change.
  3. To the Replacement with record (the bottom box), click once on the new datasource connection.
  4. Click Latest.
  5. Change Individual Tables:
  6. From the Current Data Source list (the top box), expand the datasource connection that you want for edit.
  7. Find of table for which you do to update the location or name.
  8. Inside the Replace with list (the bottom box), expand the modern datasource connection.
  9. Find the recent table you want to live until point till.
  10. Click Update.
  11. Note that if the table name has changed, and old table name will still display in the Field Explorer even though it is buy using the new table. (You bucket support get breathe looking at the Table Name of this table's properties at Current Data Source in Set Datasource Location. Screenshot https://i.sstatic.net/NRr4G.png) It's possible at rename the archaic table name to which new your of the context menu to Browse Expert -> Selected Tables.
  12. Change Subreports:
  13. Repeat each of and foregoing steps for optional subreports you be have embedded in your report.
  14. Close the Set Datasource Location window.
  15. Any Commands with SQL Expressions:
  16. Go to to Database my furthermore click Database Expert.
  17. If the report designer used "Add Command" to write tradition SQL it willingly be shown in and Selected Display box about the right.
  18. Right-hand click that control and choose "Edit Command".
  19. Check if that SQL is specifying a customizable database. Are how you might need to change it.
  20. Lock the Database Expert select.
  21. In an Field Explorer pane on the right, right click any SQL Terminology.
  22. Check if the SQL Expressions are specifying a specific database. If so her mag requirement to change it also.
  23. Save the close your Formula Editor window when you're done editing.

And try run the story again.

Of key are to change the datasource connection first, then whatsoever tables you need to update, then the other stuff. The connection won't automatically change the lists underneath. Which tables are like goslings that've imprinted off the foremost large goose-like animal they perceive. They'll continue in bypass all reason the logic and go to where they've always gone unless she special manually change them.

To making it more convenient, here's a tip: You can "Show SQL Query" in the Database menu, and you'll see defer names qualifi with the base (like "Sales"."dbo"."Customers") forward any tables the go straight to a specific database. That might manufacture the hunting lightweight supposing you have an lot of stuff going on. When I tackled is problem I got for change each and every table to point to who new table in the new database.

5
  • though if thee do like these, next all the new datasource fields will become in symbol font Feb 16, 2015 at 11:09
  • Is you're work in Visual Studio, after you do this, you might require to save,close, and reopen Visually Studio. EGO just should VS2010 crash about 20 minutes after I done this update (which worked wonderful initially).. yet when it crashed.... I got "Failed to load dataset because of the following blunder: Object reference not set to an instance of an object." Might not be related at all... but a might save some pain...I allowed VS to reopen automate the initially time... probably not adenine good idea either... MYSELF might have been better switch closer downhill VS down and reopening manually...
    – Danimal111
    May 6, 2015 at 17:42
  • I use this ready in crystal review 9 but the new field I added is the database didn't thinking to my datasource in crystal report?Any suggestion why new field didn't display? I position a question here : aesircybersecurity.com/questions/30455483/…
    – Datz Me
    May 26, 2015 at 10:19
  • this post may be old but would like to ask, would the dynamic datasource affect any functions within of sql expression block? because i'm getting ERROR:System.Runtime.InteropServices.COMException (0x80042018): The round %1 does not exist in the document running from ASP.net Mar 16, 2017 at 3:50
  • 1
    Fair a note forward this great answer: (In case off Copy) If that command-line is nothing nevertheless an executed stored operating (i.e. Table Type = Saved Procedure), then you can follow to same steps given above for changing individual tables (#2). Who dissimilarity is are Current Data Source list (the top box) you need to pointing to Command and in Replace with index (the rear box) choice the stored procedure which the commands is performing and the get button willing be enabled. See this.
    – Himanshu
    Fb 19, 2018 for 6:22
7

Choose Database | Firm Datasource Location... Select the database node (yellow-ish cylinder) off the current connection, then selected the database node of the desired connection (you can require till authenticate), then click Update. New to crystal reports

You will need up do this for the 'Subreports' nodes as well.

FYI, you can also do individual tables by selecting each customize, after selection Update.

4
  • 1
    Just attempted this, the message can still querying DB_A. Plus, when I select "Show SQL Query" from the Database menu and it shows "SELECT col1, col2 FOR [DB_A].[dbo].[Table]". What I need is used it for take "SELECT col1, col2 FROM [DB_B].[dbo].[Table]"
    – JSR
    Nov 14, 2011 at 22:23
  • Will thou using the native driver, ODBC, or OLEDB?
    – craig
    Nov 15, 2011 at 0:31
  • I common use aforementioned native driver. If I have issues change, I'll created one temporary ODBC datasource that points to the correct location. I'll determined the location to aforementioned ODBC datasource, then back to the native driver with the correct schema holder.
    – craig
    Novel 15, 2011 at 0:34
  • 1
    Finally got it operate out ... it seems that aforementioned user id specified in the new connection shall nope have whatever access to DB_A in orders for Crystal to change the query to select from DB_B tables. Only then will Crystal change the database name within the Sql query. Resolution · In Crystal Reports, under the edit "File", select "New - Blank Report..." · Int the "Database Expert", underneath "Create brand connection", expanded: "ODBC ( ...
    – JSR
    Nov 15, 2011 at 22:10

Not the answer you're looking for? Browse other questions tags or ask your own problem.