[en] Your labeling solution is connected to a database. You move your database to a new server, and your solution stops working because the database connection in your solution is now invalid. Editing your database settings in Dynamic Data Manager is time-consuming and can cause errors, especially in cases where a lot of labels and solutions are involved on several computers.
[en] You can change database connection strings outside your solutions.
[en] Solution 1
[en] If you run solutions in your Control Center or with Web Client, see the topic in the User Guide.
[en] Solution 2
[en] If you print from Desktop Designer, Designer PowerForms, or Automation, you can change the connection string with advanced databases:
-
[en] SQL
-
[en] Oracle
-
[en] MariaDB / MySQL
-
[en] databases with OLE DB connection
[en] To change the connection string, follow the steps:
-
[en] Navigate to the folder
c:\programdata\nicelabel\nicelabel 10
-
[en] Create a new file with the name
DatabaseConnections.config
. This is an XML file that will define your database connection replacement data. -
[en] Copy the following content to the config file:
<DatabaseConnectionReplacements> <Replacement> <From>Data Source=mySQLServer</From> <To>Data Source=NEW_mySQLServer</To> </Replacement> <Replacement> <From>Initial Catalog=myDatabase</From> <To>Initial Catalog=NEW_myDatabase</To> </Replacement> </DatabaseConnectionReplacements>
-
[en] Replace the string Data Source=mySQLServer with your old connection string and Data Source=NEW_mySQLServer with your new connection string.
注意
[en] You can find your existing connection string if you open your solution in Desktop Designer. Open Dynamic Data Manager, then click Connection Setup. In Database Connection Properties window, click Show Connection String.
[en] Some connection strings use the syntax
Data Source=servername
, while others useServer=servername
. -
[en] Replace the string myDatabase with your old database name and NEW_myDatabase with your new database name.
-
[en] With the text editor, open the file
product.config
. The file is located in the same folder asDatabaseConnections.config
file. -
[en] Add the following tag before the
</general>
tag:[en]
<UseLocalReplacementStrings>True</UseLocalReplacementStrings>
-
[en] In the Services console, restart NiceLabel Proxy Service 10. If you print from Automation, restart also NiceLabel Automation Service 10.
[en] Repeat the procedure on all computers that run solutions with affected databases. Solution files don't change after this procedure. The procedure just overrides database connections when running your solutions.
注意
[en] Database connection string replacement doesn't change connection strings in your label files. This procedure just overrides connection strings when printing.