Forum Moderators: open
Only change I made was using it with an Access DB instead of SQL.
I am getting the following error:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/ads.asp, line 12
This is the code, anyone have an idea? :
<!--#include file="ipaddressconvert.asp" -->
<%
dbPath = "C:\#*$!\geo.mdb"
DSNString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&dbPath
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DSNString
slocSQL = "SELECT country_CODE3 FROM ip_country WHERE ' & Dot2LongIP & ' BETWEEN IP_FROM AND IP_TO"
Set RsLoc = Conn.Execute(slocSQL)
check_country = Trim((RsLoc.Fields("country_CODE3").value))
IF RsLoc.EOF THEN
%>
<!--#include file="ads/1.htm" -->
<%
ELSE
IF check_country = "USA" OR "CAN" THEN
%>
<!--#include file="ads/2.htm" -->
<%
ELSE
%>
<!--#include file="ads/1.htm" -->
<%
END IF
END IF
%>
There are 5 columns in the DB: IP_FROM, IP_TO, COUNTRY_CODE2, COUNTRY_CODE3, COUNTRY_NAME.
IP_FROM and IP_TO are numbers. Should these columns be defined in Access as numbers or something other than text for the SQL 'BETWEEN' to function properly?
and try this...
slocSQL = "SELECT country_CODE3 FROM ip_country WHERE '" & Dot2LongIP & "' BETWEEN IP_FROM AND IP_TO"
Note the quotes around the variable Dot2LongIP. Leave no spaces between quotes. Spread out it would look like this...
' " & Dot2LongIP & " '
Just copy and paste the line.
using 'text' should not be an issue
I have an ad for a dialup internet service that I do not want to display to people who are already on cable modem/ADSL or higher.
Is there a simple detection routine where I can shoo all the high-speed types away?
Yes I know about Browserhawk but it seems like overkill and it is also seems to be in .NET only. I'm looking for a simple Vbscript..
You want one to be linked at the top of your page and one at the bottom.
I'd recommend javascript for the first embed because it's the easiest in VBScript. you don't have to output and data, you just have to makie sure that the mime type of your scripts is set to "text/javascript"
Store the current time in miliseconds in the Session variable.
As your second script, present it as an ebedded image <img src="speeddetect2.asp">
In that second script you want to subtract the time in the session variable from the current time in milliseconds. If it is below your speed threshold amount (do some speed tests with a modem and with a DSL line to get an idea), then Response.redirect to your graphical advertsement. If it's above the threshold then response.redirect to another image.