wincc database

How can you create a database user in the WinCC Runtime database for access via the MS OLE DB provider?
Description:
If the MS OLE DB provider is to be used for access to the WinCC Runtime database, you must specify a database user and password in the "ConnectionString" for setting up connections to the database:
string myConnectionString =      "Provider=SQLOLEDB;
  Data Source = \WINCC>;
  uid =
  pwd =
  Initial Catalog = ";

If the specified user is not in the database or the user does not have sufficient rights, access to the database is prevented.
Note:
  • When using the WinCC OLE DB provider, there is no user or password specified in the "ConnectionString".
  • If the same Windows users are logged on to the computers with the Connectivity Pack Server and Client and these users are also using the same password, then it is NOT necessary to create separate user roles or users in the SQL server or in the Runtime database. In this case there is no need for specifying the user name and password in the "ConnectionString" for connection setup. Instead, use the following connection parameters:
    "Integrated Security=SSPI; Persist Security Info=false;"
    Information on this is available in the Online Help for the Connectivity Pack under "Access via OLE DB Provider > Set up connection to the archive database".
To be able to use the MS OLE DB provider to access the WinCC Runtime database, you can use an existing user with sufficient rights or you create an new user accordingly for this purpose. Below we describe how to create a new user in the WinCC Runtime database.

 

No. Procedure
1 Open the WinCC project You open the project in the WinCC Explorer (WinCC Control Center). Note:
This automatically attaches the WinCC Runtime database to the SQL server. The Runtime database is then "visible" for the following steps in the "Microsoft SQL Server Management Studio". It does not have to be attached manually.
2 Open "Microsoft SQL Server Management Studio"
  • Open the "Microsoft SQL Server Management Studio" on the WinCC computer. You can use the Windows Start menu for this:
    "Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio".
  • The "Connect to Server" dialog window opens. Click the "Connect" button to acknowledge this dialog.
3 Create a new login in the SQL server instance of WinCC
  • In the "Object Explorer" of the "Microsoft SQL Server Management Studios" you select the item "\WINCC > Security > Logins" under the SQL server instance and right-click to open the pop-menu. Select the menu command "New Login...". A window opens for creating a new login.

    ( 48 KB )
    Fig. 01
  • Enter the name of the new login in the "Login name" input box.
  • Select the "SQL Server authentication" option and enter the password and confirm it appropriately in the "Password" and "Confirm password" input boxes.
  • Deselect the following options.
    • "Enforce password policy"
    • "Enforce password expiration" (this is deselected automatically if "Enforce password policy" is deselected)
    • "User must change password at next login" (this is deselected automatically if "Enforce password policy" is deselected)
    ( 80 KB )
    Fig. 02
     
  • Click the "OK" button to create the new login.
4 Create a new user in the WinCC Runtime database
  • In the "Object Explorer" of the "Microsoft SQL Server Management Studios" you select the item "... > Security > Users" under the WinCC Runtime database and right-click to open the pop-up menu. Select the menu command "New User...".

    ( 54 KB )
    Fig. 03

    Note:
    The name of the WinCC Runtime database corresponds to the "Data Source Name" of the Runtime database. Entry ID 9061684 contains all the detailed information you need about the determining the "Data Source Name".

    A window opens for creating a new database user.

    ( 44 KB )
    Fig. 04
  • Enter the name of the name of the new user in the "User name" input box. You can use the same name as in Step 3.
     
  • Enter the login name used in Step 2 in the "Login name" input box.

    Note:
    With the "..." button on the right of the "Login name" input box you can look for logins in the database and select them.
     
  • Fill in the "Default schema" and "Database role membership" fields.

    Note:
    If you only wish to have read access to the Runtime database, read-only access rights suffice. In this case you select the value "db_datareader" as "Default schema" and select the item "db_datareader" in the "Database role membership" list.
     
  • Click the "OK" button to create the new user.

Komentar

Postingan Populer