Database Hosting
Explaining the options
This page describes the database hosting service offered by IFSC. For
help on Axisbase in general (including hosting it yourself on your own
server), see
www.axisbase.com.
You can use Axisbase in desktop mode, or host the data here, or host it on the server
of your choice. (It's your data - you decide.)
A hosted database if a file that is stored on an internet-connected server, and
can be accessed from anywhere. It is important to understand that a hosted database
is not a web application. In the same way that a
web browser connects to
a
web server, a
database client connects to a
database server.
The two most common ways to use a hosted Axisbase database are to connect to it
directly from Axsibase on a workstation, or to connect to it from a web site. You
can also write code to access the database from any machine, or do any combination
of these.
You can use Axisbase to put all the information into the database,
and at the same time, the database can be accessed from a public web
site (see below), where users can search and view the up-to-date records.
This way, your data are centralized, and you never have to copy data
between your office and your web site.
While you can run the Axisbase server on your local network, the reasons why
you might want to have it hosted with IFSC (or some other provider) include:
- Your own server may not be accessible from the internet or may have limited connectivity.
- You may want to take advantage of zero-programming web features that come with the
hosting (see below).
- You can download database backups and have your data stored at two physical locations.
IFSC Hosting
Features of IFSC hosting
Hosting at IFSC gives you access to web scripts that can help you connect your web
site to your database.
Without any programming, you can allow website visitors to search through records the way you define, and even post new records. This is useful for jobs postings, stock availability, members of organizations, sports events, or any list that you manage. All you need is Axisbase on your desktop (free), a database hosted here at ianford.com (free), and a specially-formatted URL. The search results can include pictures and custom formatting.
>
See a simplified demo
Creating a hosted database
Starting from the www.ianford.com "My Account" menu link, choose the option to create
a new hosted database, and follow the instructions from there. Once created, to
connect to it, you need Axisbase installed on your workstation. In the Axisbase launchpad, expand the Tasks menu group and
click on "Connect to Server". The information
you need to connect will be provided when you create the database.
How to connect the database to a web site
You may write your own code to access the database from a web site, or
you can use the searching and posting features (WebScripts) that come with the IFSC hosting plan. The
provided features have only basic funcionality; anything that goes beyond
that should be custom coded for your specific application.
The WebScripts are as follows:
- Axisbase1SearchA - Use this script when you want users to be able to
enter search criteria and produce a list of matching records of one record type.
- Axisbase1SearchB - Use this script when you want users to be able
to enter search criteria based on a Data Subset defined in your database, and output
the results using a template defined on your web site.
- Axisbase1PostA - Use this script to allow users to post new records
to your database. This is often a good replacement for web forms that email you
the entries, because it allows you to track what they enter more effectively.
Click here for a demo of these scripts in action.
Here are the
basic steps you need to use any of the scripts:
- Create the hosted database (see instructions above).
- Connect to your database in Axisbase with the super user. Create a user called "web"
and assign a temporary password, such as "web". Close Axisbase.
- Connect to the database again, but log in as "web" this time, then change the password
to a permanent password when prompted. (Note: The reason you have to go through
these steps is to hide the password from people who view the HTML in your web pages.)
- Choose the "Manage hosted database" option (under My Account) and enter the permanent
web password in the space provided. You will also enter other items here depending
on which scripts you are using.
Using Axisbase1SearchA
Note: Axisbase1SearchA is for very simple searches; we recommend Axisbase1SearchB
most most applications.
Let's start with an example. Here is some HTML code you could place on your web
site to allow searching for lost pets:
Lost a pet? Search for found pets here...
<iframe frameborder=yes width=800 height=500
src="http://www.ianford.com/Axisbase1SearchA.aspx
?host=pluto.axisbase.com
&axisid=MOON
&type=pet
&cricols=kind,city
&cricaptions=Kind of pet,Seen in city
&resultcols=date,kind,description"
/>
The
iframe element allows your page to act as a container for another
page. The page inside the frame is controlled by ianford.com.
Features and limitations of this script that you should know about are:
- The criteria must be string or numeric properties.
- It will not search on dates and you cannot control formatting of dates.
- Reference properties will show a number instead of the referenced record.
- It will only show up to 500 records.
To set this up on your site:
- Follow the basic steps above; then:
- In the "Manage hosted database" option, enter the name of the record type that
you wish to allow for public searches. (In this example, the record type is "pet".)
- Copy the iframe element above to the web page where you want searching. But you
must place it all on one line (NOT as shown above) and change the entries to match
your application. Change the 'axisid' entry to your Axis ID. Change the 'type' entry
to the record type. Change 'cricols' to the list of properties of the type that
serve as search criteria. Change 'cricaptions' to the captions that you want to
show for the criteria - in the same order as 'cricols'. Change 'resultcols' to the list of properties that you
want shown in the result list.
- View your page in a browser.
Using Axisbase1SearchB - Basic
Axisbase1SearchB works off a Data Subset and parameters. So before you even start
connecting your data subset to a web site, you should get it working in Axisbase.
If there are no parameters defined, the search will not ask for any information
from the user. You will probably want the data subset to give the user one or more
options to search by, for example, by description, by name, by date range, and so
on depending on the type of records. More complete help is found on
www.axisbase.com.
Assuming your data subset is working in Axisbase, it can be connected to get the
same behavior on your public web site. Here is some HTML code you could place on your web
site to allow searching for lost pets:
Lost a pet? Search for found pets here...
<iframe frameborder=yes width=800 height=500
src="http://www.ianford.com/Axisbase1SearchB.aspx
?host=pluto.axisbase.com
&axisid=MOON
&subset=MOON.webpetsearch
&resultcols=MOON.pet.date,MOON.pet.kind,MOON.pet.description
&table=MOON.pet"
/>
The
iframe element allows your page to act as a container for another
page. The page inside the frame is controlled by ianford.com.
Features and limitations of this script that you should know about are:
- Reference properties will show a number instead of the referenced record.
- If you include a blob property in the output, it will be treated as an image. You
don't have to do anything special to get images to show in the output.
- It will only show up to 500 records.
To set this up on your site:
- Follow the basic steps above; then:
- In the "Manage hosted database" option, enter the name of the data subset (with
the Axis ID) that you wish to allow for public searches. (In this example, the name
is "MOON.webpetsearch".)
- Copy the iframe element above to the web page where you want searching. But you
must place it all on one line (NOT as shown above) and change the entries to match
your application. Change the 'axisid' entry to your Axis ID. Change the 'subset'
entry to the subset name. Change 'resultcols' to the list of data subset column
names that you want shown in the result list. Change 'table' to the data subset
table name, which is usually the Axis ID and record type name separated by a dot.
- View your page in a browser.
Using Axisbase1SearchB - Templated Results
The basic search given in the previous section always formats the results as a table. If you want a more
specialized appearance, you can write a template in HTML, and store it on your web
site. The search script will then read that template and perform a mailmerge on
it to generate the search results. With this technique, you can alter the fonts,
place images as you want them, and so on.
Here is an example template, for use with the example lost pet search. You should
write the template in Notepad, and
copy the template to your web site, but don't link to it. No one will ever look
at the template directly.
$loop MOON.pet$
<hr>
On #MOON.pet.date#, a #MOON.pet.kind# was lost.
<br><i>Description: #MOON.pet.description#</i>
$endloop$
The loop and endloop constructs are required as shown, but you must use the table
name defined by your Data Subset, instead of MOON.pet. Anything appearing before
or after the loop/endloop constructs will only appear once, while the portion of
the file between the two will be repeated for each row of the data table.
To tell the search script about your template, omit the 'resultcols' and 'table' parts of the script URL,
and use 'template' instead, as shown in this example:
Lost a pet? Search for found pets here...
<iframe frameborder=yes width=800 height=500
src="http://www.ianford.com/Axisbase1SearchB.aspx
?host=pluto.axisbase.com
&axisid=MOON
&subset=MOON.webpetsearch
&template=http://my.web.site.com/lostpettemplate.txt"
/>
As noted above, the src="....." part of the page must appear on one line, NOT as shown above.
Using Axisbase1PostA
Axisbase1PostA receives its data from a web form that you design and post on your web site, and converts that data to a database record.
Let's start with an example, which asks the user for three fields of information:
Lost a pet? Please fill out this form.
<form method=post enctype="multipart/form-data"
action="http://www.ianford.com/Axisbase1PostA.aspx
?host=pluto.axisbase.com
&axisid=MOON
&type=pet" >
<br />Kind of pet: <input name="p_kind" />
<br />Description: <input name="p_description" />
<br />Date lost: <input name="p_date" />
<input type=hidden name=notify value=myemail678@mydomain.com />
<br /><input type=submit />
</form>
When the form is submitted, the script creates a new record of type pet.
Here are the rules for designing your form:
- The 'action' part of the page should be on one line in your page, not on four lines
as shown here.
- Change the host and Axis ID to match your database.
- Change the 'type' entry to the name of the record type that you wish to create.
- For each form field that matches a property name of that type, use the property
name preceeded by "p_". For example, "p_kind" in the form will match "kind" in Axisbase.
- You may include the hidden field 'notify'; the value should be your
email address. If this is included, then you will get a notification email when
the form is submitted by anyone.
- To use a
checkbox, include these attributes in your input element:
type=checkbox value="YES"
- To allow the user to upload a file, include this attribute in your input element:
type=file. This only works if the property is defined as blob.
Example: <input name=p_image type=file />
- You may include the whole form inside an iframe element. This technique
keeps the look and feel of your site present after the user submits the form.
To set up your site to use Axisbase1PostA:
- Follow the basic steps above; then:
- In the "Manage hosted database" option, enter the name of the record type that you
wish to allow people to create. (In this example, the name is "pet".)
- Create a page containing a <form> element that conforms to the rules and example
above. You may place anything else you wish on this page.
- View your page in a browser.