<% connStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("Database\PROVIDERSoraquest.mdb") '& ";Mode=ReadWrite|Share Deny None;Persist Security Info=False" 'connstr="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hulltest;Data Source=HP\SQLDEV2000" set rs = server.CreateObject("adodb.recordset") set con = server.CreateObject("adodb.connection") 'set con.ConnectionString = con.Open(connStr) zipcode = request("zipcode") 'If Not IsNumeric(zipcode) Then zipcode = 0 userdistance = request("distance") lastname = trim(request("lastname")) city = trim(request("city")) submitted = request("submitted") specialty = trim(request("specialty")) 'userdistance = 4 sql = "select SpecialtyName from specialty order by specialtyname" rs.Open sql, con specialtyString = "" if not rs.EOF then while not rs.EOF specialtystring = specialtystring & "" rs.movenext Wend end if rs.Close sql = "SELECT DISTINCT City FROM ProviderList ORDER BY City" Set rs = con.Execute(sql) cityString = "" & vbCrLf rs.Close %>
Our Provider Search Engine has move to our new website www.firstcontdental.com.

Click on the Link above to be redirected to our new website.

Please click on "Find Dentist" on our new website to look for an Oraquest Provider.

<% 'Response.Write connStr const pi = 3.14159265358979323846 if len (zipcode) > 0 then sql = " select distinct pl.zip as providerzip, z1.zip_code as userzip, z1.latitude as z1latitude, z1.longitude as z1longitude, z2.latitude as z2latitude, z2.longitude as z2longitude " sql = sql & " from zipcodes z2, zipcodes z1, providerlist pl " sql = sql & " where pl.zip = z2.zip_code and z1.zip_code = " & zipcode 'response.Write "
" & sql rs.CursorLocation = 3 rs.Open sql,con, 1,4 rs.ActiveConnection = nothing zipcodelist = "" i = 0 invalidzip = false if rs.EOF then response.Write "The zip code you entered is invalid " invalidzip = true Else while not rs.EOF dist = cdbl(getdistance(rs("z1Latitude"), rs("z2latitude"), rs("z1longitude"), rs("z2longitude")) ) 'Use DM schedule DLL 'dist = CDbl(getDistanceDM(zipcode, rs("providerzip"))) 'response.write dist & " " & rs("providerzip") & "
" If userDistance <> 0 Then If dist < cdbl(userdistance) Then zipcodelist = zipcodelist & rs("providerzip") & "," i = i + 1 End If Else zipcodelist = zipcodelist & rs("providerzip") & "," i = i + 1 End if rs.MoveNext wend End if rs.Close 'response.Write zipcodelist End if If submitted = 1 then 'response.Write zipcodelist sql = "SELECT DISTINCT FirstName+' '+LastName AS Doctor, ProviderList.ClinicName, ProviderList.[Facility#] As FacilityNum, ProviderList.Specialty, ProviderList.Address, ProviderList.City, ProviderList.ST, ProviderList.Zip,Phone " sql = sql & " FROM ProviderList " sql = sql & " WHERE 1=1 " if len(zipcodelist) > 0 then zcslength = len(zipcodelist)-1 zipcodelist = left(zipcodelist,zcslength) sql = sql & " and ProviderList.Zip In (" & zipcodelist & ") " End if if len(lastname) > 0 then sql = sql & " and lastname like '%" & Replace(lastname, "'", "''") & "%'" end if if city <> "All" then sql = sql & " and city like '%" & Replace(city, "'", "''") & "%'" end if if specialty <> "All" then sql = sql & " and specialty like '%" & Replace(specialty, "'", "''") & "%' " end if sql = sql & " order by City, ClinicName" 'response.Write sql rs.Open sql, con, 3, 2 Response.Write "
Search Results" & rs.RecordCount & " results found
" if not rs.EOF then i = 0 providerstring = "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" 'Response.Write "" Response.Write "" Response.Write "" while not rs.EOF if isnull(rs("ClinicName")) then clinicName = "N/A" Else clinicName = rs("ClinicName") End if '& "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" &vbCrLf i = i + 1 rs.MoveNext Wend response.Write providerstring Response.Write "
DoctorClinic NameFacility#SpecialtyAddressCityStateZipPhone
" & rs("ST") Response.Write "
" & rs("Doctor") & "" & clinicName & "" & rs("FacilityNum") & "" & rs("Specialty") & "" & rs("Address") & "" & rs("City") & "" & rs("Zip") & "" & rs("Phone") & "
" Else Response.Write "No providers found " End if RS.Close End if ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: This function get the arccos function from arctan function ::: ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Function getDistance(z1Latitude, z2latitude, z1longitude, z2longitude) distancecomponent = cdbl(cos(deg2rad(90-z1LATITUDE))*cos(deg2rad(90-z2latitude))+sin(deg2rad(90-z1LATITUDE))*sin(deg2rad(90-z2LATITUDE))*Cos(deg2rad(z1LONGITUDE - z2LONGITUDE))) distance = distancecomponent distance = 3963*acos(distancecomponent) getDistance = distance End Function Function GetDistanceDM(Zip1, Zip2) Set objHull = Server.CreateObject("DocketMaster.DMSchedule") GetDistanceDM = objHull.getDistance(CLng(Zip1), CLng(Zip2)) Set objHull = Nothing End Function Function getdistance3(lat1, lat2, lon1, lon2) Dim theta, dist theta = lon1 - lon2 dist = sin(deg2rad(lat1)) * sin(deg2rad(lat2)) + cos(deg2rad(lat1)) * cos(deg2rad(lat2)) * cos(deg2rad(theta)) dist = acos(dist) dist = rad2deg(dist) distance = dist * 60 * 1.1515 getdistance3 = cdbl(distance) 'Select Case ucase(unit) ' Case "K" ' distance = distance * 1.609344 ' Case "N" ' distance = distance * 0.8684 'End Select End Function function GetDistance2(Lat1, Lat2, Long1, Long2) dim x ' do the nasty calcs x = (sin(DegToRads(Lat1)) * sin(DegToRads(Lat2)) + cos(DegToRads(Lat1)) * _ cos(DegToRads(Lat2)) * cos(abs((DegToRads(long2))-(DegToRads(long1))))) ' Get Acos(x) x = atn((sqr(1-x^2))/x) ' Get distance in kilometers GetDistance2 = 1.852 * 60.0 * ((x/pi)*180) GetDistance2 = GetDistance2 / 1.609344 ' Convert units if necessary ' select case ucase(Unit) ' case "M" ' ' case "N" ' GetDistance = GetDistance / 1.852 ' end select' ' end function '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: This function converts decimal degrees (e.g. 79.1928376) to radians ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function DegToRads(Deg) DegToRads = cdbl(Deg * pi / 180) end function '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: This function converts decimal degrees (e.g. 79.1928376) to degrees, ::: '::: minutes and seconds ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: sub DecimalDegToDMS(DecimalDegrees, Degs, Mins, Secs) Dim temp Degs = fix(DecimalDegrees) temp = (DecimalDegrees - Degs) * 60. Mins = fix(temp) temp = (temp - Mins) * 60. Secs = fix(temp) end sub Function acos(rad) If Abs(rad) <> 1 Then 'acos = pi/2 - Atn(rad / Sqr(1 - rad * rad)) acos = -ATN(rad/SQR(1-rad*rad)) + Pi/2 ElseIf rad = -1 Then acos = pi End If End function Function Arccos(distanceComp) If x = 1 Then Arccos = 0 Exit Function End If Arccos = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1) End Function ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: This function converts decimal degrees to radians ::: ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Function deg2rad(Deg) deg2rad = cdbl(Deg * pi / 180) End Function ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: This function converts radians to decimal degrees ::: ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Function rad2deg(Rad) rad2deg = cdbl(Rad * 180 / pi) End Function Function getDistance4(Latitude1, Latitude2, Longitude1,Longitude2) Dim R Dim Lat Dim Lon Dim a Dim c 'Radius of the Earth (Km) 'Select Case UCase(Measurement) ' Case "MILES" ' R = 6367 * 0.6214 ' Case "KILOMETERS" ' R = 6367 'End Select R = 6367 * 0.6214 'Calculate the Deltas... Lon = AsRadians(Longitude2) - AsRadians(Longitude1) Lat = AsRadians(Latitude2) - AsRadians(Latitude1) 'Intermediate values... a = Sin2(Lat / 2) + Cos(AsRadians(Latitude1)) * Cos(AsRadians(Latitude2)) * Sin2(Lon / 2) 'Intermediate result c is the great circle distance in radians... c = 2 * Arcsin(GetMin(1, Sqr(a))) 'Multiply the radians by the radius to get the distance in specified units... GetDistance4 = R * c End Function Function AsRadians(Degrees) 'To convert decimal degrees to radians, multiply 'the number of degrees by pi/180 = 0.017453293 radians/degree AsRadians = Degrees * (3.14159265358979 / 180) End Function Function Sin2(X) Sin2 = (1 - Cos(2 * X)) / 2 End Function Function Arcsin(X) Arcsin = Atn(X / Sqr(-X * X + 1)) End Function Function GetMin(X, Y) 'The min() function protects against possible roundoff errors that 'could sabotage computation of the arcsine if the two points are 'very nearly antipodal If X <= Y Then GetMin = X Else GetMin = Y End If End Function con.Close Set con = nothing Set rs = nothing %>