Trusted Database Command File Installation Documentation 


Using the Trusted Database Command File, CSKDBtrusted.CMD:

CSKDBtrusted.CMD can automate installing the CSKDotNet 1.1 database objects over trusted connections. You can use this file instead of the CSKDB.CMD file that shipped with the CSKDot 1.1 project.

The first thing to do is to copy the included CSKDBtrusted.CMD and CreateASPNETDatabaseUser.sql into your CSKDotNet 1.1's /SQL folder (along side the old CSKDB.CMD file).

CSKDBtrusted.CMD can operate in 3 modes:

The CSKDBtrusted.CMD file can be executed from a command window (DOS prompt). You can copy the entire /SQL folder to your local machine to make running the command file easier.

CSKDB.CMD Syntax:

CSKDBtrusted.CMD [Server], [Database], [Action]

CSKDBtrusted.CMD parameters:
Usage Example:

 CSKDBtrusted.CMD localhost, MyDatabase, new

Creating the ASPNET user account for trusted access:

To create a trusted logon that the ASP.NET worker process can use to access the SQL server, you must edit and execute the included CreateASPNETDatabaseUser.sql file against your database (or use Enterprise manager to create such an account). Then you must edit the connection string in web.config to use the trusted connection.

First, edit the CreateASPNETDatabaseUser.sql file. replace all occurances of "@MachineName@" with the name of your server machine. If your web server uses a domain account instead of a local account for the ASP.NET worker process, replace "@MachineName@/ASPNET" with the domain and user name used by your web (as defined in machine.config).

Also, you must replace "@DatabaseName@" with the name of the CSKDotNet 1.1 database you created when you ran CSKDBtrusted.CMD.

Next, use SQL Query Analyzer or another similar tool to execute the script against your database to create the login and grant it the correct permissions. You can also use OSQL at the command line to run this script. At the command prompt simply type this:

osql -S %1 -d %2 -E -b -i "CreateASPNETDatabaseUser.sql"

Note: replace %1 with the server name and %2 with the database name before you use this OSQL command.

Finally, you need to update your connection string in web.config with one that uses a trusted connection. Here is an example of such a connection string:

server=localhost;Trusted_Connection=true;database=CommunityStarterKit