Set up Database

Set up Database

VPASP supports 3 types of database, Access, SQLServer and MySQL.



MS Access Setup

VPASP comes with a MS Access database and is configured to use this database as default.  It is recommended that you move the database (shopping600.mdb) from the root VPASP directory and place it into a different directory.
This directory needs to have write permissions enabled so that the database can be updated.
You also need to modify your shop$config.asp file to point to the new database location.



SQL Server Setup

SQL Server is a complex Microsoft software product.  From the VP-ASP point of view it is very simple to use.  The steps in using SQL Server are:

  1. Create the SQL Server database. This can be done using SQL Server's Query analyzer or it may have been created for you by your web hosting company

  2. Add the VP-ASP Tables

  3. Load the configuration table with default values

  4. Optionally add the demo shop values


Web Hosting company has created the database
If your web hosting company has already created the database and you DO NOT have the ability to use Query Analyzer, then VP-ASP supplies a tool called convertsql.asp. This tool can be used to build the VP-ASP tables but  cannot create the database.

It can build the tables and load the default configuration. It can also load the demo shop if required.

To use convertsql.asp, you must first tell VP-ASP where the empty SQL Server database is located by changing these lines in shop$config.asp

Xdatabase=”yourdatabasename”
xdatabasetype="SQLSERVER”
xSqlUser=”youruserid”
xSQlpwd=”yourpassword”
xSQLServer=”www.yoursite.com” or IP Address in form “111.22.333.90”

Use convertsql.asp from your browser

www.yoursite.com/shopping/convertsql.asp

Building SQL Server Tables

Type in the filename
Create500sqlserver.txt

You will see messages being displayed telling you the tables that are being created. If you get an error that the database cannot be read or written, check the shop$config statements above. 

Loading the Configuration File
The next step is to load the default configuration options.  Now start convertsql.asp by typing the location where you installed VP-ASP  www.yoursite.com/shopping/convertsql.asp

Type in file name below. This loads the initial configuration and language file

Create500admin.txt

Loading Demo Shop
This step is only necessary if you want to “play” with VP-ASP demo shop. Otherwise it is not necessary. Use convertsql.asp and type in the filename create500demo.txt. This loads the database with the demo shop.

The SQL Server database is loaded and ready. You should now be able to click shop on the home page and see the product categories.

Creating the SQL Server – Query Analyzer 

If you have expertise with SQL Server, you can use the SQL Server tool called Query Analyzer to create the database.  The database needs to be created using SQL Server Query Analyzer or your web hosting company sometimes creates the database for you. Query Analyzer comes as part of the Microsoft SQL Server Product and is not supplied by VP-ASP. 
Please note YOU CANNOT USE THE UPSIZING WIZARD TO BUILD VP-ASP TABLES

1 Query Analyzer Creation
Simply start Query Analyzer. Open the file create500sqlserver.sql and run the script. It should take about ten seconds.  The database and the tables are now created. 

Updating Shop$config.asp
The shop$config.asp settings should be as follows: 

Xdatabase=yourdatabasename
xdatabasetype="SQLSERVER”
xSqlUser=”youruserid”
xSQlpwd=”yourpassword”
xSQLServer=”www.yoursite.com” or IP Address in form “124.77.090.90”



MySQL Setup

 

MYSQL Install on Unix

  1. Create a directory under your current web site called shopping
    It does not have to be called shopping, that is only a recommendation.
  2. Unzip all files into the shopping directory
  3. Create the MYSQL database  
  4. Add the demo data to the MYSQL  (see Adding Demo Data below)
  5. Update shop$config.asp to tell VP-ASP where your database is located

Unix - Creating MYSQL database via command level

  1. The actual database can be called anything you want. 
    In our file it is called mysql550.

    Edit the file mysqlcreate550.txt and change the database name on these lines

    drop database if exists mysql550;
    create database if not exists mysql550;
    use mysql550;

    Then type at the command level:

    mysql < create550mysql.txt

    The database and tables are now created. This only takes a few seconds.

    Now load the Shop Configuration defaults
    mysql < create550admin.txt
  2. To load the demo shop files
    mysql < create550demo.txt
  3. Updating shop$config.asp
    If you have not already done so above, you need to edit file 
    shop$config.asp.

    Edit shop$config.asp and change the following values

    const xDatabase="mydatabasename" 'Database name
    const xdatabasetype="MYSQL" ' Do not change this 
    const xSQLUser="myuserid" ' MYSQL Server user
    const xSQLPwd="mypassword" ' MYSQL Server password
    const xSQLServer="127.0.0.1" ' MYSQL Server name or IP address
  4. Start your browser and point to the shopping directory and you should now see the default VP-ASP home page 
  5. Click on the shop button and you should see the demo shop  categories.

MYSQL Install on Windows PC

To use MYSQL under Windows you must have installed MYSQL database support for Windows. See www.mysql.com. All other requirements for Windows and ASP must also be met as noted below.

Windows -Running VP-ASP on your own local Personal Computer
First determine what Windows operating system you have.  Then determine if you have the appropriate Microsoft prerequisites.  If you have Windows 95/98 VP-ASP requires that you have the free Microsoft product called Personal Web Server (PWS). 

If you do not have PWS installed, then you must install it. It comes either free on your Windows CDROM or it can be downloaded from the web. Please see http://www.vpasp.com/virtprog/info/faq_pws.htm

If you have Windows NT/Windows 2000/XP Professional 

VP-ASP requires that you have  Microsoft Internet Information Server (IIS). 
This is available on the NT or XP CDROM. 

If you have Windows ME/XP Home

Unfortunately Microsoft has not made available any software  that can run ASP on these operating systems.  To evaluate VP-ASP you will need to use VP-ASP on your  web hosting company.

Steps to install VP-ASP on your local PC

  1. Create a folder on your hard drive called "shopping". It does not have to be called shopping, that is only a recommendation.
  2. Unzip all files into the shopping directory
  3. Create the MYSQL database 
  4. Add the demo data to the MYSQL

Windows - Creating MYSQL database 

  1. Use the Windows tool WinSqlAdmin to create your database. This will create an empty database. You click on databases and then right click on the computer name. This should bring up a dialog to create a new database.
  2. Edit shop$config.asp and change the following values

    const xDatabase="mysql550"           'Database name
    const xdatabasetype="MYSQL"        ' Do not change this 
    const xSQLUser="myuserid"             ' change to user userid
    const xSQLPwd="mypassword"        'change to your userid
  3. const xSQLServer="localhost"         ' Normally this will be OK
  4. After updating shop$config.asp,
    start the file mysqlcreate.asp  from your browser. 
    http://www.mysite.com/shopping/mysqlcreate.asp
    or http://localhost/shopping

    If you have trouble starting VP-ASP or running ASP files see http://www.vpasp.com/virtprog/info/faq_helpme.htm
  5. Type the file name create550mysql.txt 
    It will try to connect to the database, add the VP-ASP tables. If successful it will list the commands being issued and tell you of a successful completion. This only takes a few seconds.
  6. Next run mysqlcreate.asp again and type in filename

    create550admin.txt

    This adds entries to the VP-ASP configuration table 
  7. To add the demo shop data use the file mysqldemo550.txt

    Using the browser command mysqlcreate.asp, type in the name 
    create550demo.txt



Diagnostic Tools

Our diag_dbtest diagnostic tool or shopdbtest for releases prior to 5.0, tests if the directory has been set-up correctly to read and write the database. 

  1. First run the diagnostic tool diag_dbtest.asp
    If this fails then the permissions for Windows NT/2000/XP IUSR are not correct OR you have the wrong settings in shop$config.asp (see below)
  2. In addition, after an error occurs, you can type diag_sessionlist.asp. We store the exact open failure message in a session variable called "OpenError". This may give you a hint on why the database cannot be opened. Many of the Microsoft error messages are listed here.

    Database configuration is particular to each Server. Depending on whether you are hosting with an ISP or (locally) on your own PC/network you should pass the above information to your hosting company (ISP) or System Administrator. Direct them to this URL
    http://www.vpasp.com/virtprog/info/faq_setup.htm 

OR

The problem may simply be a configuration setting in VP-ASP which is described below. 

 


Times Viewed:
7723
Added By:
Steve Baldwin
Date Created:
10/6/2005
Last Updated:
12/28/2005