Tabliz Searching


Searching a Record in a Recordset

To perform searches with TaBliz you use the SearcForm object and their properties. You generate the SearchForm using the DoSearchForm method of Tabliz object; see our simple sample to learn more about the basics.

Starting from the SearchForm you can get either the Editing List or a Report based on a template. You simply have to set the Action property to tblzShowEditingList or to tblzShowReport. Let's take a look at the sample below:

dim TBLZ
dim TplPath
set TBLZ = Server.CreateObject("Tabliz.adminrecordset")
%>
<!--#include file="customtabliz.asp"-->
<% 
TBLZ.DatabasePath = "C:\www_odbc\october28\tabliz2000.mdb"
TBLZ.recordset = "MainTable"
TplPAth = Request.ServerVariables("APPL_PHYSICAL_PATH") & "\template.htm"
TBLZ.Report.Template.Path = TplPath
TBLZ.SearchForm.Action = tblzShowReport
TBLZ.Report.PageSize = 25
tblz.DoSearchForm

This code will generate a Search Form. After the user clicks on the Search button a report will be generated since the SearchForm.Action was set to tblzShowReport. The report is based on the template (template.htm) that must exist in the phisycal path of the application. (to learn more about templates please read Doing Reports )  

You can set the SearchForm.Action  property to two values (tblzShowEditingList or tblzShowReport) defined in customtabliz.inc If you don't set the property the default value(tblzShowEditingList) is used and the Editing List is displayed.

You can set HideOrderByRow property to true if you don't like the row with the orderby criterion in the SerachForm Table; like this

TBLZ.SearchForm.HideOrderByRow = true
tblz.DoSearchForm

Likewise the HideTopDistinctRow property hides the row with the Top and distinct criterion

tblz.HideTopDistinctRow = true
tblz.DoSearchForm

Adding a field to the HiddenFields collection you can remove the fields you don't like in the search form (for more infos on this see hiding fields ).

tblz.SearchForm.HiddenFields.Add "IDMainTable"

Once the SearchForm is generated the page user can use wildcards with the "LIKE" parameter to perform advanced searches in the database.
He should select LIKE as criterion. Then he can, for example, write %ocean% in the value field and retrieve all field containing ocean word.
If he write _isch un the value field he retrieve fish but also dish and so on.
Another example:
%_ish_ retrieves all the fields containing a word starting with any character followed by ish.
This syntax is the same as the ADO SQL syntax. The only thing you (as a web developer) have to do at this point is to explain this to your users on the site. You can easily do this with a link to a help file in the web interface.