Wiki source code of Connectionstring anpassen

Last modified by Sabrina V. on 2024/10/08 11:35

Hide last authors
Jannis Klein 1.1 1 {{aagon.priorisierung}}
2 160
3 {{/aagon.priorisierung}}
4
5 {{aagon.floatingbox/}}
6
Jannis Klein 17.1 7 = General information about the connection string =
Jannis Klein 1.1 8
Jannis Klein 17.1 9 The ACMP server uses the connection string to connect to the SQL Server. It is created and filled by the ACMP setup during installation. After installation, the connection string can also be adjusted manually.
Jannis Klein 1.1 10
Jannis Klein 17.1 11 The connection string contains various attributes, such as the provider or the data sources used, but also security information of the respective user, such as the user name or the password.
12
13 The connection string is generated by ACMP and stored in the installation directory. It is a persistent file that can be accessed by the ACMP Server at any time. The file always has the same attributes. Some values and properties can be changed by a free entry, for others only the two values //True// and //False// are available. The connection string is implicitly filled with the data you enter during installation (e.g. database used, user name, password, etc.). To do this, the information you enter in the installation wizard is transparently transferred to the file and stored there. The connection string can also be used to establish an encrypted connection between the SQL Server and the ACMP Server.
14
Jannis Klein 1.1 15 {{figure}}
Jannis Klein 17.1 16 (% style="text-align:center" %)
17 [[image:Neue Datenbank anlegen.png]]
Jannis Klein 1.1 18
19 {{figureCaption}}
Jannis Klein 17.1 20 Implicit entry of the connection string data via the installation wizard
Jannis Klein 1.1 21 {{/figureCaption}}
22 {{/figure}}
23
Jannis Klein 17.1 24 It may be necessary to adapt the existing session data in the following cases, for example
Jannis Klein 1.1 25
Jannis Klein 17.1 26 * - Migration of another SQL Server (e.g. from MS SQL Server 2012 to 2019).
27 * - Relocation of the SQL Server to another host
28 * - Change of user credentials (the ACMP database login is changed)
29 * - Migration of a database
30 * Data transfer to be encrypted afterwards
Jannis Klein 1.1 31
Jannis Klein 17.1 32 == **Invoking the //db.~~co// and //db.con// files** ==
Jannis Klein 1.1 33
Jannis Klein 17.1 34 The files to customise the connection string are located in the server directory of the ACMP Server (e.g. C:\Program Files (x86)\Aagon\ACMP Server). The files you need to customise the connection string are the //db.~~co// and //db.con// files.
35 The aim is to change the //db.con// file because this is used by the ACMP Server to connect to the SQL Server. This file is normally encrypted if the ACMP Server has been successfully started at least once. To be able to modify and customise the data in a meaningful way, you need the structure and the readable content of the connection string. This data can be found in the //db.~~co// file, as the plain text can be extracted from it.
Jannis Klein 1.1 36
Jannis Klein 17.1 37 Navigate to the server directory of the ACMP Server and open the file //db.~~co// with a text editor of your choice (e.g. Notepad++). A connection string with various attributes will open. In the following figure, for example, these are attributes such as the provider, the user ID or the SQL Server instance.
Jannis Klein 1.1 38
39 {{figure}}
Jannis Klein 17.1 40 (% style="text-align:center" %)
41 [[image:db.co Datei.png]]
Jannis Klein 1.1 42
43 {{figureCaption}}
Jannis Klein 17.1 44 Content of the db.~~co file
Jannis Klein 1.1 45 {{/figureCaption}}
46 {{/figure}}
47
48 {{aagon.infobox}}
Jannis Klein 17.1 49 ACMP does not use the //db.~~co// file directly to read information. Rather, it is intended as a template in which you can enter your values and transfer them to the //db.con// file.
Jannis Klein 1.1 50 {{/aagon.infobox}}
51
Jannis Klein 17.1 52 When you then open the other file, the //db.con// file, you will see an encrypted content consisting of a long string of numbers and letters. Because of the encryption, you will no longer be able to see the position of the //password// attribute, for example.
Jannis Klein 1.1 53
54 {{figure}}
Jannis Klein 17.1 55 (% style="text-align:center" %)
56 [[image:db.con Datei.png]]
Jannis Klein 1.1 57
58 {{figureCaption}}
Jannis Klein 17.1 59 Encrypted db.con file
Jannis Klein 1.1 60 {{/figureCaption}}
61 {{/figure}}
62
63 {{aagon.infobox}}
Jannis Klein 17.1 64 If the correct values are entered for the five attributes "Provider", "Password", "User ID", "Data Source" and "Initial Catalog", the encryption of the //db.con// file is automatic. After the ACMP Server has successfully connected to the SQL Server, the //db.con// file is encrypted so that the connection string is no longer in clear text in the file, but can only be decrypted by the ACMP Server.
Jannis Klein 1.1 65 {{/aagon.infobox}}
66
Jannis Klein 17.1 67 == C**ustomising attributes in the connection string** ==
Jannis Klein 1.1 68
Jannis Klein 17.1 69 You can customise several categories of information within the connection string. These include user-specific information (//password// and //user// //ID//) and database-related information (//data source// and //initial// //catalogue//). To create an encrypted connection between the servers, change the attributes of the //Use encryption for data// and //Trust server certificate// entries.
70 First, go back to the //db.~~co// file where the readable attributes are stored. Copy the contents of this file and switch back to the //db.con// file. Now find the attributes you want to change or add to the existing attributes.
Jannis Klein 1.1 71
72 {{aagon.warnungsbox}}
Jannis Klein 17.1 73 It is important that you enter the values correctly. Errors or typing mistakes can result in the ACMP Server not being able to connect to the SQL Server and therefore no login is possible.
Jannis Klein 1.1 74 {{/aagon.warnungsbox}}
75
76 Nachfolgend einige Erklärungen zu den Werten:
77
Jannis Klein 17.1 78 |(% style="width:221px" %)**Attributes**|(% style="width:1142px" %)**Description**
79 |(% style="width:221px" %)Provider=SQLNCLI11.1|(% style="width:1142px" %)The provider used here is the Microsoft SQL Server Native Client, version 11.1. The access library used to access the SQL Server should not be changed.
80 |(% style="width:221px" %)Password=(clear)|(% style="width:1142px" %)(((
81 The password refers to the user ID/user for the SQL Server used within the connection string. If an incorrect password is entered, an error message is generated when the ACMP Server is started. In addition you will find an entry in StartUpError.txt (C:\Program Files (x86)\Aagon\ACMP Server) why ACMP could not be started successfully.
Sabrina V. 11.1 82
Jannis Klein 17.1 83 Enter the required password here.
84 )))
85 |(% style="width:221px" %)Persist Security Info=True|(% style="width:1142px" %)(((
86 A value of True means that security information (e.g. user ID or password) can be retrieved. If the value is set to False, problems and error messages may occur when connecting to the ACMP Server.
Sabrina V. 11.1 87
Jannis Klein 17.1 88 Possible values that can be entered True or False
Sabrina V. 11.1 89 )))
Jannis Klein 17.1 90 |(% style="width:221px" %)User ID=ACMPDBUser|(% style="width:1142px" %)The User ID information refers to the SQL login with which the ACMP logs on to the SQL Server. A successful login is a prerequisite for starting the ACMP Server.
91 |(% style="width:221px" %)Initial Catalog=ACMP|(% style="width:1142px" %)The entered User ID (SQL Login) should have DB Owner rights of the database. This is the database name.
92 |(% style="width:221px" %)(((
93 Data Source=ServerNameEnter.aagon.local\SQLEXPRESS
Jannis Klein 1.1 94
Jannis Klein 17.1 95
96 )))|(% style="width:1142px" %)Represents the SQL Server instance. The extension .aagon.local corresponds to your local domain. \SQLEXPRESS is the instance name of the SQL Server to which you want to connect (here: Microsoft SQL Server Express).
97 |(% style="width:221px" %)(((
98 Use encryption for data=false
Jannis Klein 1.1 99
Jannis Klein 17.1 100
101 )))|(% style="width:1142px" %)(((
102 The data sent via a transfer can also be encrypted. To do this, the value must be set to True, otherwise no encryption will take place. In this case the data/values of a table are encrypted so that they cannot be intercepted or read. The value False can be used if only network internal transfer paths are used that do not cross the Internet.
103
104 Possible values that can be entered True or False
105 )))
106 |(% style="width:221px" %)(((
107 MARS Connection=False
108
109
110 )))|(% style="width:1142px" %)(((
111 This value is disabled by default. To enable MARS Connection, set the value to True. This function allows you to run several batches through a single connection.
112
113 Possible values that can be entered True or False
114 )))
115 |(% style="width:221px" %)(((
116 DataTypeCompatibility=80
117
118
119 )))|(% style="width:1142px" %)Default value of the system requirements for the OLE DB driver for SQL Server.
120 |(% style="width:221px" %)(((
121 Trust Server Certificate=False
122
123
124 )))|(% style="width:1142px" %)(((
125 When set to True, all certificates are considered valid. If set to False, a certificate check is forced as each certificate is checked individually during the connection process.
126
127 Possible values that can be entered: True or False
128 )))
129
130 For the changes to be applied, you must save and close the file. If you are still running ACMP Console, exit the application.
131
Jannis Klein 1.1 132 {{aagon.infobox}}
Jannis Klein 17.1 133 If you correct or change values in the //db.con// file, it is a good idea to close the ACMP Console, otherwise you may lose data. Unsaved content may be lost. If you do not close the application during your work, you will get a message that the current session has expired and needs to be restarted.
Jannis Klein 1.1 134 {{/aagon.infobox}}
135
Jannis Klein 17.1 136 Now open the ACMP Server via the service administration "Services" and close the server with the same name. Wait a moment until the service is closed on the local computer and then restart it. The adjusted conditions will be loaded and a newly encrypted db.con file will be displayed.
Jannis Klein 1.1 137
138 {{aagon.infobox}}
Jannis Klein 17.1 139 You can use the //StartUpError.txt// file to check that the server has been successfully restarted.
Jannis Klein 1.1 140 {{/aagon.infobox}}
141
142 {{figure}}
Jannis Klein 17.1 143 (% style="text-align:center" %)
144 [[image:Diensteverwaltung ACMP Server beenden.png]]
Jannis Klein 1.1 145
146 {{figureCaption}}
Jannis Klein 17.1 147 Exit Service Management ACMP Server
Jannis Klein 1.1 148 {{/figureCaption}}
149 {{/figure}}
150
Jannis Klein 17.1 151 The updated //db.con// file will have a different sequence of numbers and letters after the ACMP server has been restarted, due to the re-entry of your data.
Jannis Klein 1.1 152
Jannis Klein 17.1 153 = Encrypt connection string =
Jannis Klein 1.1 154
Jannis Klein 17.1 155 The connection string is automatically encrypted if you have entered the values of the attributes "Provider", "Password", "User ID", "Data Source" and "Initial Catalog" correctly. You must enter these five attributes correctly to establish a connection between the ACMP Server and SQL Server. If you enter an incorrect value in the //db.con// file, the file can be saved but no connection can be established. Therefore, always check your entries to ensure a successful connection between the two servers.
Jannis Klein 1.1 156
Jannis Klein 17.1 157 Encryption of the connection string is used to prevent other users from reading the authentication credentials.
Jannis Klein 1.1 158
Jannis Klein 17.1 159 = **Establishing an encrypted connection between ACMP Server and SQL Server** =
Jannis Klein 1.1 160
Jannis Klein 17.1 161 The user credentials passed can also be encrypted in the connection string. To do this, when editing the attributes, set the //Use encryption for data// value to //True// to encrypt the transmission. This will encrypt the data so that it can only be read by the ACMP Server. In addition to the attribute mentioned here, you will need to customise the other values. Update and save the //db.con //file so that it can be read by the ACMP Server when it is restarted.
162
163 See also: [[Enabling encryption>>https://docs.microsoft.com/de-de/dotnet/framework/data/adonet/connection-string-syntax#sqlclient-connection-strings]]
© Aagon GmbH 2025
Besuchen Sie unsere neue Aagon-Community