database Crystal Reports 更改数据源
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2803209/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Crystal Reports Changing the Data Source
提问by Batuta
I have a Crystal report where the data source has originally been set to use ODBC connections. Now I want to modify the data source to instead use OLE DB instead of using ODBC. How do I replace the data source connection without breaking the database fields which I have originally set up for my report? If I try to delete the original data source, the fields which I have already set up are also deleted. Is there a way to map the report to use OLE DB instead of the ODBC connection?
我有一个 Crystal 报表,其中数据源最初设置为使用 ODBC 连接。现在我想修改数据源以使用 OLE DB 而不是使用 ODBC。如何在不破坏我最初为报表设置的数据库字段的情况下替换数据源连接?如果我尝试删除原始数据源,我已经设置的字段也会被删除。有没有办法将报告映射为使用 OLE DB 而不是 ODBC 连接?
Thanks.
谢谢。
回答by Rini
Its easy. Right click on the database fields in your field explorer. Click on 'Set datasource location' And then you will see two sections in a dialog. "Current datasource" and "replace with". In the current datasource - select the object you want to replace. Then in the "Replace with" section click on "create new connection">"OLE DB">Connect to the database object that you want by supplying driver and credential information.
这很简单。右键单击字段浏览器中的数据库字段。单击“设置数据源位置”,然后您将在对话框中看到两个部分。“当前数据源”和“替换为”。在当前数据源中 - 选择要替换的对象。然后在“替换为”部分单击“创建新连接”>“OLE DB”>“通过提供驱动程序和凭据信息连接到所需的数据库对象”。
Then click the 'update' button on the right side. That's it! You're done. Though the object name might not seem to change in the 'current datasource' section, still if u click on the (+) sign next to the object, the source name will show the new OLEDB object that you used
然后单击右侧的“更新”按钮。就是这样!你完成了。尽管“当前数据源”部分中的对象名称似乎没有更改,但如果您单击对象旁边的 (+) 号,源名称仍将显示您使用的新 OLEDB 对象
回答by Batuta
Try:
尝试:
- Adding the OLE DB data source to the report withoutdeleting the ODBC data source.
- Use the Set Datasource Location option (from the Database menu in the Report Designer) to change the datasource for the table from the ODBC data source to the OLE DB data source.
- Thendelete the ODBC data source from the report.
- 将 OLE DB 数据源添加到报表而不删除 ODBC 数据源。
- 使用“设置数据源位置”选项(从报表设计器的“数据库”菜单中)将表的数据源从 ODBC 数据源更改为 OLE DB 数据源。
- 然后从报告中删除 ODBC 数据源。
回答by user6582975
Crystal Report 8.5
水晶报表 8.5
Click 'Database' menu->Click 'Remove From Report'->Select the tables which you want to remove from the list->click 'Remove' option->Click 'Done'Button.
单击“数据库”菜单->单击“从报告中删除”->选择要从列表中删除的表->单击“删除”选项->单击“完成”按钮。
That's it:)
就是这样:)