Hi, everyone,
I'm trying to update an Access db: if link is ok, then status=up else status=down, in a form with 3 fields: sitename, link, status:
<%
Server.ScriptTimeout = 150
Set db = Server.CreateObject("ADODB.Connection"
db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/press/baza/data.mdb" & ";"
set rs=Server.CreateObject("ADODB.Recordset"
mySQL = "SELECT * FROM ziare ORDER BY ziar ASC"
rs.open mySQL, db, 1, 1
rs.MoveFirst
Do Until rs.EOF
SiteName = rs("name"
GotothisURL = rs("link"
Set GetConnection = CreateObject("Microsoft.XMLHTTP"
GetConnection.Open "get", GotothisURL, False
on error resume next
GetConnection.Send
ResponsePage = GetConnection.responseText
if ResponsePage="" then
sql = "INSERT INTO sites (status) VALUES ('down') WHERE SiteName = rs("name""
else
sql = "INSERT INTO sites (status) VALUES ('up') WHERE SiteName = rs("name""
db.Execute(sql)
UPDATE sites
Set GetConnection = Nothing
Set ResponsePage = Nothing
rs.MoveNext
Loop
rs.close
set rs = nothing
%>
What is wrong??
Please help,
Thank you
I'm trying to update an Access db: if link is ok, then status=up else status=down, in a form with 3 fields: sitename, link, status:
<%
Server.ScriptTimeout = 150
Set db = Server.CreateObject("ADODB.Connection"
db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/press/baza/data.mdb" & ";"
set rs=Server.CreateObject("ADODB.Recordset"
mySQL = "SELECT * FROM ziare ORDER BY ziar ASC"
rs.open mySQL, db, 1, 1
rs.MoveFirst
Do Until rs.EOF
SiteName = rs("name"
GotothisURL = rs("link"
Set GetConnection = CreateObject("Microsoft.XMLHTTP"
GetConnection.Open "get", GotothisURL, False
on error resume next
GetConnection.Send
ResponsePage = GetConnection.responseText
if ResponsePage="" then
sql = "INSERT INTO sites (status) VALUES ('down') WHERE SiteName = rs("name""
else
sql = "INSERT INTO sites (status) VALUES ('up') WHERE SiteName = rs("name""
db.Execute(sql)
UPDATE sites
Set GetConnection = Nothing
Set ResponsePage = Nothing
rs.MoveNext
Loop
rs.close
set rs = nothing
%>
What is wrong??
Please help,
Thank you