|
|
<%
If strSearch <> "" Then
' MapPath of virtual database file path to a physical path.
' If you want you could hard code a physical path here.
strDBPath = Server.MapPath("data/ncc1.mdb")
' Create an ADO Connection to connect to the sample database.
' We're using OLE DB but you could just as easily use ODBC or a DSN.
Set cnnSearch = Server.CreateObject("ADODB.Connection")
' This line is for the Access sample database:
cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
' Build our query based on the input.
strSQL = "SELECT name, URL, title, thumb_URL, text " _
& "FROM photo_gallery " _
& "WHERE name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
'& "OR first_name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
'& "SORT BY main_date DESC; " _
' Execute our query using the connection object. It automatically
' creates and returns a recordset which we store in our variable.
Set rstSearch = Server.CreateObject("ADODB.Recordset")
rstSearch.PageSize = PAGE_SIZE
rstSearch.CacheSize = PAGE_SIZE
' Open our recordset
rstSearch.Open strSQL, cnnSearch, adOpenStatic, adLockReadOnly, adCmdText
' Get a count of the number of records and pages
' for use in building the header and footer text.
iRecordCount = rstSearch.RecordCount
iPageCount = rstSearch.PageCount
If iRecordCount = 0 Then
' Display no records error.
%>
<%
Else
' Move to the page we need to show.
rstSearch.AbsolutePage = iPageCurrent
' Show a quick status line letting people know where they are:
%>
| The information displayed herein is provided in good faith,
but we make no guarantees about the completeness, accuracy,
timeliness, availability, accessibility, merchantability, or
fitness for any particular purpose of any of the information.
The City Council Of Nairobi is not responsible for any errors
or omissions, which may occur in the information provided. |
| Any reference made by The City Council Of Nairobi in this
web site to any company or any other entity, or to their services
or products, is not an endorsement nor should it imply any such
endorsement of the quality or fitness of purpose of that company
or entity, or its services or products. |
| The City Council Of Nairobi disclaims all liability and responsibility
for any loss, damage, or inconvenience whatsoever or howsoever
suffered, directly or indirectly by any person as a result of
their use of this web site and of any information and contact
details supplied. |
| Any person proposing to use or rely on any of the contact
details should first satisfy themselves of the completeness
and accuracy of those contact details and any other information
displayed with or in relation to them on this web site. |
| Any access of this web site by the user is entirely at the
user's own risk and The City Council Of Nairobi shall not be
responsible for the propagation of computer worms or viruses
transmitted from the site. By accessing this web site you agree
with these conditions and agree to hold harmless the operators
and maintainers of the web site and their agents and partners. |
|
|
|