<%@ LANGUAGE="VBSCRIPT" %> Bullseye PRO Dealer Locator version 2.0

<% 'On Error Resume Next '---- 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 Dim dropDown ' load companies found in listbox Dim strCount ' used to count companies found from search dropDown= "" strCount = Null If ((Request("op") = "update") OR (Request("op") = "addnew") OR (Request("op") = "options")) Then Set qLogin = Request("qLogin") Set qPassword = Request("qPassword") Else Set qLogin = Request("Login") Set qPassword = Request("Password") End If Set Number = Request("Number") %> <% Set conn = Server.CreateObject("ADODB.Connection") ' Set objRec= Server.CreateObject ("ADODB.Recordset") conn.Open "DSN=zipsearch" ' conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data\islamicbase.mdb" ' objRec.Open "companies", conn, 1, 1, 2 'while Not objRec.EOF 'Response.Write objRec ("company") & "," 'objRec.MoveNext 'Wend ' verify login user id and pass adminSQL = "SELECT * FROM AdminInfo;" Set adminQuery = Conn.Execute(adminSQL) If ((qLogin = adminQuery("Login")) AND (qPassword = adminQuery("Password"))) Then %> <% Select Case Request("op") Case "delete" remSQL = "SELECT * FROM Companies WHERE CompanyNumber = " & Request("CompanyNumber") & ";" Set remQuery = Conn.Execute(remSQL) If Not(remQuery.EOF) Then remStr = remQuery("Company") dSQL = "DELETE * FROM Companies WHERE CompanyNumber = " & Request("CompanyNumber") & ";" Set dQuery = Conn.Execute(dSQL) End If Case "options" If Trim(Request("map")) = "" Then strMap = " False " Else strMap = "True " End If optionsSQL = "UPDATE AdminInfo SET AdminInfo.Login = '" & Request("Login") & "', AdminInfo.Password = '" & Request("Password") & "', AdminInfo.User1Name = '" & Request("User1Name") & "', AdminInfo.User2Name = '" & Request("User2Name") & "', AdminInfo.User3Name = '" & Request("User3Name") & "', AdminInfo.map =" & strMap & ", AdminInfo.color ='" & Request("color") & "' ;" Set optionsQuery = Conn.Execute(optionsSQL) Case "update" CurrentTime = Date() strCount= -2 instSQL = "UPDATE Companies SET " Call BuildSQL("Company", instSQL, "Text") Call BuildSQL("Street", instSQL, "Text") Call BuildSQL("Street2", instSQL, "Text") Call BuildSQL("City", instSQL, "Text") Call BuildSQL("State", instSQL, "Text") Call BuildSQL("Zip", instSQL, "Text") Call BuildSQL("Country", instSQL, "Text") Call BuildSQL("Phone", instSQL, "Text") Call BuildSQL("Fax", instSQL, "Text") Call BuildSQL("EMail", instSQL, "Text") Call BuildSQL("URL", instSQL, "Text") Call BuildSQL("ContactName", instSQL, "Text") Call BuildSQL("ContactPosition", instSQL, "Text") Call BuildSQL("User1", instSQL, "Text") Call BuildSQL("User2", instSQL, "Text") Call BuildSQL("User3", instSQL, "Text") Call BuildSQL("Approved", instSQL, "Bool") Call BuildSQL("Login", instSQL, "Text") Call BuildSQL("Password", instSQL, "Text") instSQL = instSQL & "DateEntered = " & CurrentTime & " " instSQL = instSQL & "WHERE CompanyNumber = " & Request.Form("CompanyNumber") & ";" set instQuery = conn.execute(instSQL) Case "addnew" Set rsInsert = Server.CreateObject("ADODB.RecordSet") rsInsert.Open "Companies" , Conn, 3, 3 rsInsert.AddNew rsInsert("Company") = CleanValue("Company", "Text") rsInsert("Street") = CleanValue("Street", "Text") rsInsert("Street2") = CleanValue("Street2", "Text") rsInsert("City") = CleanValue("City", "Text") rsInsert("State") = CleanValue("State", "Text") rsInsert("Zip") = CleanValue("Zip", "Text") rsInsert("Country") = CleanValue("Country", "Text") rsInsert("Phone") = CleanValue("Phone", "Text") rsInsert("Fax") = CleanValue("Fax", "Text") rsInsert("EMail") = CleanValue("EMail", "Text") rsInsert("URL") = CleanValue("URL", "Text") rsInsert("ContactName") = CleanValue("ContactName", "Text") rsInsert("ContactPosition") = CleanValue("ContactPosition", "Text") rsInsert("User1") = CleanValue("User1", "Text") rsInsert("User2") = CleanValue("User2", "Text") rsInsert("User3") = CleanValue("User3", "Text") rsInsert("Approved") = CleanValue("Approved", "Bool") rsInsert("Login") = CleanValue("Login", "Text") rsInsert("Password") = CleanValue("Password", "Text") rsInsert("DateEntered") = Date() rsInsert.Update rsInsert.Close Case "search" strCount = 0 If Request.Form("SearchName")<> "" Then strName = Request.Form("Searchname") strSQL = "SELECT * FROM Companies WHERE (Company LIKE '%" & strName & "%' ) Order By Company ;" Set rsQuery = Conn.Execute(strSQL) While NOT rsQuery.EOF AND strCount <100 dropDown = dropDown & "