Setting up a SQL Anywhere database connection

Before a PowerBuilder .NET Web Forms application connects to a SQL Anywhere® database, you must either start the database manually or grant the ASPNET user (IIS 5 on Windows XP), the IIS_WPG user group (IIS 6 on Windows 2003), or IIS_IUSRS (IIS 7 on Windows Vista and IIS 7.5 on Windows 7) default permissions for the Sybase\Shared and Sybase SQL Anywhere directories, making sure to replace permissions of all child objects in those directories.

Full control permissions are required for directories containing databases that you need to access from your Web Forms applications.

NoteStarting the database manually If your database configuration uses a server name, you must provide the database server name in the start-up options when you start the database manually, in addition to the name of the database file you are accessing.

Granting ASP.NET user permissions

If you do not grant the appropriate user permissions for Sybase directories and your database configuration is set to start the database automatically, your application will fail to connect to the database. SQL Anywhere cannot access files unless the ASPNET, IIS_WPG, or IIS_IUSRS user group has the right to access them.

StepsTo grant an ASP.NET user permissions for Sybase directories:

  1. In Windows Explorer, right-click the Sybase, Sybase\Shared or Sybase SQL Anywhere directory and select Properties from the pop-up menu.

    The Properties dialog box displays for the selected directory.

  2. Select the Security tab of the Properties dialog box for the directory and click the Add button. On Vista and Windows 7, click Edit and then Add.

    The Select Users, Computers, or Groups dialog box displays.

  3. Click Locations and choose the server computer name from the Locations dialog box and click OK.

  4. Type ASPNET (IIS 5), IIS_WPG (IIS 6), or IIS_IUSRS (IIS 7 and 7.5) in the list box labeled “Enter the object names to select” and click OK.

    If valid for your server, the account name you entered is added to the Security tab for the current directory. (You can check the validity of a group or user name by clicking Check Names before you click OK.)

  5. Select the new account in the top list box on the Security tab, then select the check boxes for the access permissions you need under the Allow column in the bottom list box.

    You must select the Full Control check box for a directory containing a database that you connect to from your application.

  6. Click the Advanced button.

    The Advanced Security Settings dialog box displays for the current directory.

  7. Select the check box labeled “Replace permission entries on all child objects with entries shown here that apply to child objects” and click OK.

    A Security dialog box displays, warns you that it will remove current permissions on child objects and propagate inheritable permissions to those objects, and prompts you to respond.

  8. Click Yes at the Security dialog box prompt, then click OK to close the Properties dialog box for the current directory.

NoteTracing runtime exceptions The pbtrace.log file is created in the applicationName_root directory. This file records all runtime exceptions thrown by the application and can be used to troubleshoot the application.