Hey all,
Just like to say first off: Thanks to everyone, i couldn't survive without you guys.
Okay here is my problem. I have a set of scripts for posting online ads. One particular script is supposed to find all of the records that are past 30 days old and delete them. I figured with would be easy, but no luck so far. Here is my script:
<%
Dim query
Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
dbGlobalWeb.ConnectionTimeout = 15
dbGlobalWeb.CommandTimeout = 30
dbGlobalWeb.Open "DBQ=" & Server.MapPath("emarket.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20 ;", "username", "password"
query = "DELETE * FROM listings WHERE TO_DAYS(NOW()) - TO_DAYS(DatePosted) > '30'"
dbGlobalWeb.Execute query
%>
<center>
Cleanup completed successfully!<br><br>
<a href="admin_cp.asp">Back to Control Panel </a>
</center>
<%
dbGlobalWeb.Close
Set con = Nothing
%>
But I keep getting errors about the TO_DAYS in the query. I used that from a reference on this page:
http://www.phpbuilder.com/mail/php-db/2001051/0084.php. I know it was for php, but I thought it would translate to ASP. Any help is greatly appreciated.
Michael W. Vollmer