% ' Constants ripped from adovbs.inc: Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = &H0001 ' Our own constants: Const PAGE_SIZE = 15 ' The size of our pages. ' Declare our variables... always good practice! Dim strURL ' The URL of this page so the form will work ' no matter what this file is named. Dim cnnSearch ' ADO connection Dim rstSearch ' ADO recordset Dim strDBPath ' path to our Access database (*.mdb) file Dim strSQL ' The SQL Query we build on the fly Dim dstrSearch ' The text being looked for Dim iPageCurrent ' The page we're currently on Dim iPageCount ' Number of pages of records Dim iRecordCount ' Count of the records returned Dim I ' Standard looping variable ' Retreive the URL of this page from Server Variables strURL = Request.ServerVariables("URL") ' Retreive the term being searched for. I'm doing it on ' the QS since that allows people to bookmark results. ' You could just as easily have used the form collection. xstrSearch = Request.QueryString("search") xstrSearch = Replace(xstrSearch, "'", "''") ' Retrieve page to show or default to the first If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If ' Since I'm doing this all in one page I need to see if anyone ' has searched for something. If they have we hit the DB. ' O/W I just show the search form and quit. %>