PreviousUser's Guide (v9 SP2 (9.5) revision 1) Next

Setting up Database Access with PCC

Chapter contents

You must know the name of the server where the database is located. If the database already has a DBNAME, PCC uses it. If you wish to create a new database but use existing data files, you must know the location of the data files on the server.

To create up an Engine DSN on a remote machine, you must possess administrator rights on the remote machine that houses the database you wish to access. You must have OS system rights to create a System DSN on the local machine.

Setting Up Database Access on Windows

To Set Up Database Access on Windows

  1. Follow the steps listed in To register a remote server engine .
  2. Existing databases with a DBNAME on the registered server can then be accessed from PCC.

  3. Optionally, follow the steps listed in To create a new database in Advanced Operations Guide.
  4. The new database can then be accessed from PCC.

To Set Up ODBC Database Access on Windows

  1. Follow the steps listed in To register a remote server engine .
  2. Existing databases with a DBNAME and a DSN on the registered server can then be accessed from PCC.

  3. Optionally, follow the steps listed in To create a new database in Advanced Operations Guide and ensure that the Create DSN option is selected (check marked).

  4. By default, PCC creates a system DSN with the same name as the database name. The new database has a DSN associated with it and can be accessed through ODBC.

  5. Optionally, create a DSN with ODBC Administrator for an existing database:
    1. In PCC, click Tools 4 ODBC Administrator.
    2. Click the System DSN tab.
    3. Click Add.
    4. In the list, click Pervasive ODBC Engine Interface.
    5. Click Finish.
    6. Type a desired name for Data Source Name.
    7. For Database Name, click the name of the database in the list for which you want to create the Engine DSN.
    8. Click OK.
    9. Click OK.

Setting Up Database Access on a NetWare Server

To Set Up Database Access on a NetWare Server from a Client Workstation

  1. Follow the steps listed in To register a remote server engine .
  2. Existing databases on the registered server can then be accessed from PCC.

  3. Optionally, follow the steps listed in To create a new database in Advanced Operations Guide.
  4. The new database can then be accessed from PCC.

To Set Up ODBC Database Access on on a NetWare Server from a Client Workstation

  1. Follow the steps listed in To register a remote server engine .
  2. Existing databases with DSNs on the registered server can then be accessed from PCC.

  3. Optionally, follow the steps listed in To create a new database in Advanced Operations Guide and ensure that the Create DSN option is selected (check marked).

  4. By default, PCC creates a system DSN with the same name as the database name. The new database has a DSN associated with it and can be accessed through ODBC.

  5. Optionally, create a DSN with ODBC Administrator for an existing database:
    1. In PCC, click Tools 4 ODBC Administrator.
    2. Click the System DSN tab.
    3. Click Add.
    4. In the list, click Pervasive ODBC Engine Interface.
    5. Click Finish.
    6. Type a desired name for Data Source Name.
    7. For Database Name, click the name of the database in the list for which you want to create the Engine DSN.
    8. Click OK.
    9. Click OK.

Setting Up Database Access on a Linux Server

To Set Up a Named Database and Engine DSN from a Linux Server

Database names are created in Linux by using the dbmaint utility at the server. For a complete description of dbmaint, see dbmaint or read the dbmaint man page.


Note
This utility can only be run by user accounts belonging to group pvsw. See Getting Started With Pervasive PSQL (Server edition) for information on Pervasive PSQL Linux utilities and user accounts.
  1. To create an empty database, use the following at the command line:
  2. dbmaint a | d | l [-b] [-i] [-e] -nDbname
    [-ldictpath] [-ddatapath] 
     

    The list of commands for dbmaint include:

    a - add database name
    d - delete database name
    l - list all database names

    Options include:

    -b - create Bound database
    -i - create database with Relational Integrity enforced
    -e - do not create dictionary files for database
    -nDBName - specify database name
    -lDictpath - specify dictionary path
    -dDatapath - specify data path
    -a - show full data in the DBNames list

    For example, to create DBName TEST with relational integrity, type:

    dbmaint a -i -nTEST

    Note
    Unless datapath is specified, the new database is created in the default location, $PVSW_ROOT/data. Likewise, if dictpath is not specified, the dictionary is created in the default location.
    • To delete an existing database, use the following at the command line:
    • dbmaint d -nDbname 
       

      For example, to delete the newly created database TEST, type

      dbmaint d -nTEST
    • To list all existing databases:
    • dbmaint l [-a] 
      
  3. To set up an Engine DSN, modify the following files:
    • ${PVSW_ROOT}/etc/odbc.ini.
    • SQLMGR required settings:

      [SQLManager]
      MgrPort=1583 
      
    • ${PVSW_ROOT}/etc/odbc.ini

    • Note
      The value of ${PVSW_ROOT} is typically /usr/local/psql.

      Server data source - the one to which remote calls will be redirected:

      [DSN name]
      Driver=/usr/local/psql/lib/libodbcci.so
      Description=Test Pervasive database
      DBQ=DBName 
       

      In addition, each data source should be mentioned in the section [ODBC Data Sources] as in the following example:

      [ODBC Data Sources] dsnName1=Pervasive PSQL database dsnName2=Pervasive PSQL database

      For example, if you have in odbc.ini:

      [MyDSN] Driver=/usr/local/psql/lib/libodbccci.so Description=test DBQ=MyDB

      then your odbc.ini should have:

      [ODBC Data Sources] MyDSN=Pervasive PSQL database

      Note
      Because Linux is case sensitive, the [DSN name] must be input exactly as listed under [ODBC Data Sources].
    • The engine DSN can also be created using the dsnadd utility by typing the following at the command line:
    • % dsnadd -dsn=DSNname -db=DBName 
       

      An easy way to verify DBName and DSN configuration settings is to run the supplied isql program using the psql user account:

      % /usr/local/psql/bin/isql DEMODATA

  4. Proceed to setting up client DSNs as explained in Setting Up Client Access .

Setting Up Client Access

To make a client able to access a remote Pervasive PSQL database

  1. Follow the steps listed in To register a remote server engine .
  2. Existing databases on the remote server can then be accessed from PCC.

  3. Optionally, follow the steps listed in To create a new database in Advanced Operations Guide.
  4. The new database can then be accessed from PCC.

To set up a Client DSN using ODBC Administrator

  1. Open the ODBC Administrator (from the Start menu, select Programs4Pervasive PSQL v9 Service Pack 24Other Utilities4ODBC Administrator).
  2. Click on the System DSN tab, then on Add.

  3. Note
    Pervasive PSQL does not support File DSNs. You must use User or System DSNs. System DSNs are generally preferred, because they are available to all users on a given computer.
  4. In the Drivers window, select Pervasive ODBC Client Interface.
  5. The following dialog box appears:

    Figure 2-5 Pervasive ODBC Client DSN Setup Screen



  6. In the Client section, type in a DSN (with a maximum length of 32 characters) for the data source to which you wish to set up a connection. This DSN will help you identify the data source. It will be visible only on the current machine.
  7. Type a description of the data source, if desired (with a maximum length of 80 characters).
  8. If you want to enable OEM/ANSI conversion, click the Options button and make your selection in the dialog box that appears.
  9. Figure 2-6 Pervasive ODBC Client DSN Options



    Do not modify the Network settings or TCP/IP Port Number unless you have first reviewed the information in ODBC DSN Creation Options in Advanced Operations Guide.

  10. Click OK to return to the Pervasive ODBC Client DSN Setup dialog box.
  11. Figure 2-7 Pervasive ODBC Client DSN Setup Screen #2



  12. In the Server area, type in the host name of the computer where the data source resides. You can enter a machine name, TCP/IP address, or an IPX/SPX MAC address.
  13. To use an existing database on the server, click the Get DSN List button and select the desired DSN from the drop-down list. In the Server area, Data Source Name refers to an Engine DSN on the server computer.
  14. If no databases appear in the drop-down list, either you selected the wrong server, or you need to have your system administrator name the server databases and create Engine DSNs for each of them before you can access them.

  15. Click OK.
  16. You can now set up another Client DSN or click OK to exit the ODBC Administrator.

Setting Up a Client DSN on a Linux Workstation

While it is possible to access a database from a Linux server by a Linux client, there are no Pervasive PSQL utilities (except dsnadd) that can be used on the client. A Linux client configuration would be used for independent applications, such as web applications.

To add a client data source, execute the following command:

dsnadd -dsn=myDSN -desc=datasource 
-host=psqlhost -sdsn=svDSN 
 

myDSN is a name you want to assign to the new Client DSN.

datasource is any string to describe the data source.

psqlhost is the name of the network host where your Pervasive PSQL database resides.

svDSN is the name of the Engine DSN on the Pervasive PSQL host.


Note
The datasource on the server must be named first.

For example, to create a Client DSN named TEST on host NewDev, where the Engine DSN name for the database is NewTest, type

dsnadd -dsn=TEST -host=NewDev -sdsn=NewTest 

For more information about the dsnadd utility, please see Getting Started With Pervasive PSQL (Server edition).


Chapter contents
Book contents

Prev topic: Setting Up ODBC Database Access
Next topic: Accessing Data via ODBC From Other Applications