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!

Change of SQL database

Status
Not open for further replies.

neilmcdonald

Technical User
Aug 16, 2002
53
Hi,

I have a crystal report written in V9, linking to a SQL database. The report was written using database A, but needs to be run on database B. The database structures are identical, but the names are different. I have set a new datasource location, but get the following error message:

Query Engine Error: '42S02:[Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'Database_A.Tablename'.'

Obviously, Database A doesn't exist, but how can I point it to Database B?



 
Hi,
In CR Designer, use the Verify Database option ( under the Database options) to update the report..

[profile]
 
Database > Set Datasource Location > browse to the correct location at the bottom and highlight it > highlight the corresponding table in the upper half of the window > click the 'Update' button.

-dave
 
Thanks for the response. I've tried both of the above, but I'm still getting the same error message.

I'd be grateful for any more ideas!

 
I have just had the same thing with a report being run on a test database going live and vidru's method worked fine. It's strange that it hasn't worked for you. Do you have subreports in your report?
 
Yes - there are three subreports. Do I need to do something to the individual subreports?
 
In your top box, you will have all the connections - for the main report and each subreport. You will need to change them all (but you will be able to do this from the main report, you shouldn't have to open the subreports in design view or anything). It sounds like you may have already done this though?
 
Hi,

I've managed to get this working, although a bit more long winded than normal. Usually, when setting the database location, I can select the two databases and choose update. This time, I had to do each table individually.

Thanks to everyone for your advice - it's much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top