%
'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
'---- LockTypeEnum Values ----
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4
Const cLinesPerPage = 7
Dim OddNumber
On Error Resume Next
MyName = Request("NAME")
MyID = Request("ID")
blnNoSearch=Request("DOCLR")
MySQL = Request("SQL")
If blnNoSearch = "" Then
MyQuickSearch = Request("searchsite")
If MyQuickSearch <> "" Then
sql = "SELECT jobTitle AS [Job Title], KeySkills AS [Key Skills], Location, Country, Salary, ID FROM tblVacancies WHERE approved = '1' AND InStr(Ucase([jobTitle]),'" & MyQuickSearch & "') > 0 OR InStr(Ucase([KeySkills]),'" & MyQuickSearch & "') > 0 ORDER BY DatePosted DESC"
Else
my_JobTitle = Ucase(Request("JOBTITLE"))
my_Industry = Request("INDUSTRY")
my_KeySkills = Ucase(Request("KEYSKILLS"))
my_Country = Request("COUNTRY")
my_Location = Ucase(Request("LOCATION"))
If my_Country = "LOCATION" Then
my_Country = ""
End If
' BUILD THE SQL TO QUERY THE TABLES
' =================================
strIgnore = "...------- Categories --------/------- Countries ----------"
blnComplex=False
sql = "SELECT jobTitle AS [Job Title], KeySkills AS [Key Skills], Location, Country, Salary, ID FROM tblVacancies WHERE approved = '1'"
blnComplex=True
If my_JobTitle <> "" Then
If blnComplex=True Then
sql = sql & " AND InStr(Ucase([jobTitle]),'" & my_JobTitle & "') > 0"
Else
sql = sql & " WHERE InStr(Ucase([jobTitle]),'" & my_JobTitle & "') > 0"
blnComplex=True
End if
End If
i = InStr(strIgnore, my_Industry)
If i = 0 Then
If blnComplex=True Then
sql = sql & " AND InStr([Industry],'" & my_Industry & "') > 0"
Else
sql = sql & " WHERE InStr([Industry],'" & my_Industry & "') > 0"
blnComplex=True
End if
End If
If my_KeySkills <> "" Then
If blnComplex=True Then
sql = sql & " AND InStr(Ucase([KeySkills]),'" & my_KeySkills & "') > 0"
Else
sql = sql & " WHERE InStr(Ucase([KeySkills]),'" & my_KeySkills & "') > 0"
blnComplex=True
End if
End If
i = InStr(strIgnore, my_Country)
If i = 0 Then
If my_Country <> "International" Then
If blnComplex=True Then
sql = sql & " AND InStr([country],'" & my_Country & "') > 0"
Else
sql = sql & " WHERE InStr([country],'" & my_Country & "') > 0"
blnComplex=True
End if
End If
End If
If my_Location <> "" Then
If blnComplex=True Then
sql = sql & " AND InStr(Ucase([location]),'" & my_Location & "') > 0"
Else
sql = sql & " WHERE InStr(Ucase([location]),'" & my_Location & "') > 0"
blnComplex=True
End if
End If
sql = sql & " ORDER BY DatePosted DESC"
End If
If MySQL <> "" Then
sql = MySQL
End If
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" + Server.MapPath("./access_db/the-jobs-site.mdb")
RS.Open sql, Conn, adOpenKeyset,adLockReadOnly
RS.PageSize = cLinesPerPage
Scroll = Request("Scroll")
If Scroll <> "" Then
Page = mid(Scroll, 5)
If Page < 1 Then
Page = 1
End If
Else
Page = 1
End If
If Not RS.EOF Then
RS.AbsolutePage = Page
End If
End If
%>
Search Jobs Listings From Around the world
<%
If blnNoSearch = "" Then
Set RS = Nothing
Conn.Close
Set Conn = Nothing
End If
%>