Installing the Rico Examples

Simply unzipping the Rico distribution file and copying the resulting directory structure into your web service's path should be sufficient to get most, if not all, of the examples running. If you have installed it into a directory called "rico" under the web service root, then you should be able to point your browser to the following address to access the examples and documentation:

http://myserver.mydomain.com/rico/

Or if you installed it on your personal computer, then access it as:

http://localhost/rico/

File Locations

The Rico distribution is divided into 4 subdirectories:

IIS Configuration

Rico can be served from any web server. This section describes some configuration issues specific to IIS on Windows.

On a server running IIS6 or higher, you will need to change the security settings for ASP in order to run the ASP examples. In particular, you will need to enable ASP files to reference include files in the parent directory. To do this, follow these steps:

  1. Open ISS Manager
  2. Right click on "Default Web Site" and select "Properties" from the context menu
  3. Click on the "Home Directory" tab
  4. Click the "Configuration" button
  5. Click the "Options" tab of the new window
  6. Check the box labelled "Enable parent paths"

In order for the sample scripts to read the Northwind Access database on a computer running IIS7 (e.g. Vista PCs), you will need to disable the loadUserProfile setting using this command:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools /[name='DefaultAppPool'].processModel.loadUserProfile:false
The technique is described in this article. If you prefer not to change the loadUserProfile setting, the alternative is to load the Northwind database into SQL Server or MySQL and change connection settings in the relevant applib file as described below.

LiveGrid Examples

Many of the LiveGrid examples fetch data from the Northwind sample database. In order to get these examples to work you will need to do 2 things:

  1. Create the Northwind database
  2. Modify the database connection settings which reside in the applib.* file

Creating the Northwind database

The examples/data directory contains several different formats of the database needed to run most of the Rico LiveGrid ASP, .net, and PHP examples.

Data is provided in these formats:

  1. northwind.mdb - this is the standard Northwind database provided by Microsoft, with the exception that the [Order Details] table has been renamed to Order_Details. If you will be accessing the ASP or .net examples, then no database configuration is necessary -- those examples will directly access this database using the Microsoft Jet driver.
  2. mysql-northwind.sql - a backup file for MySQL (created using MySQL version 4.1)
  3. mysql-northwind-dblquote.sql - same as above, except all instances of \' have been changed to '' (recommended for MySQL version 5 or above)
  4. ORA-EXPDAT.DMP - an Oracle export file for the Northwind schema -- generated using the "exp" utility in Oracle XE. The password for this schema is "password".

A version for MS SQL Server 2000 & 2005 is available as a free download from msdn.microsoft.com. After downloading it, you should follow Microsoft's intructions to install it. Finally, you will need to either rename the [Order Details] table to Order_Details, or create a view named Order_Details using the following SQL statement:


create view Order_Details as select * from [Order Details]

Database connection settings

Specific instructions depend upon your environment:

Database PHP ASP .net Perl
Connection settings located in: examples/php/applib.php examples/asp/applib.asp examples/dotnet/applib.ascx examples/perl/ricoXMLquery.pl
MySQL return $GLOBALS['oDB']->MySqlLogon( "northwind", "userid", "password"); oDB.Use_MySQL

oDB.SqlSvr="localhost"

Set the user id, and password in the SqlLogon() statement.

The Rico plug-in assumes that the MySQL 3.51 ODBC driver has been installed. If you are using a later ODBC driver, such as 5.1, then you will need to add this line:

oDB.OdbcDriver="{MySQL ODBC 5.1 Driver}"

Public const dbDialect = "MySQL"

Set the server name, user id, and password in OpenDB()

The MySQL 3.51 ODBC driver must also be installed.

$dbh = DBI->connect( "dbi:mysql:northwind", "userid", "password");
SQL Server

return $GLOBALS['oDB']->MSSqlLogon( "ServerName\InstanceName", "Northwind", "userid", "password");

Omit InstanceName when connecting to the default instance

oDB.SqlSvr= "ServerName\InstanceName"

Omit InstanceName when connecting to the default instance

Set the user id, and password in the SqlLogon() statement.

Public const dbDialect = "TSQL"

Set the server name, user id, and password in OpenDB()

 
MS Access $oDB->Dialect="Access";

return $GLOBALS['oDB']->OdbcLogon( "northwindDSN", "Northwind", "Admin", "");

oDB.Use_Access Server.Mappath( "../data/northwind.mdb")

This is the default, so no changes should be required.

Public const dbDialect = "Access"

This is the default, so no changes should be required.

 
Oracle $oDB->Dialect="Oracle";

return $GLOBALS['oDB']->OracleLogon( "XE", "northwind", "password");

oDB.Use_Oracle "XE" Public const dbDialect = "Oracle"

Set the server name and password in OpenDB()

 
DB2

not supported

  Public const dbDialect = "DB2"

Set the server name, user id, and password in OpenDB()

 
PostgreSQL return $GLOBALS['oDB']->PostgreSqlLogon(connection_string);

The connection_string can be empty to use all default parameters, or it can contain one or more parameter settings separated by whitespace. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value or a value containing spaces, surround it with single quotes, e.g., keyword = 'a value'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.

The currently recognized parameter keywords are: host, hostaddr, port, dbname (defaults to value of user), user, password, connect_timeout, options, tty (ignored), sslmode, requiressl (deprecated in favor of sslmode), and service. Which of these arguments exist depends on your PostgreSQL version.