<% adParamInput = 1 adInteger = 3 adDate = 7 ' **** NEVER EVER USE THIS IN PRODUCTION **** Function sleep(n) timeout = Now() + (n / (24 * 60* 60)) Do While Now() < timeout ' do nothing Loop End Function Set con = Server.CreateObject("ADODB.Connection") con.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Work\Database11.accdb;User Id=admin;Password=;" Set ins = Server.CreateObject("ADODB.Command") ins.ActiveConnection = con ins.CommandText = "INSERT INTO dtest VALUES(@i,@d)" ins.Parameters.Append(ins.CreateParameter("@i", adInteger, adParamInput)) ins.Parameters.Append(ins.CreateParameter("@d", adDate, adParamInput)) For i = 0 To 9 ins.Parameters("@i").Value = i ins.Parameters("@d").Value = Now() ins.Execute sleep(1) Next Set ins = Nothing Set sel = Server.CreateObject("ADODB.Command") sel.ActiveConnection = con sel.CommandText = "SELECT * FROM dtest WHERE d > @d" sel.Parameters.Append(sel.CreateParameter("@d", adDate, adParamInput)) cut = Now() - 6 / (24 * 60 * 60) sel.Parameters("@d") = cut Set rs = sel.Execute Do While Not rs.EOF Response.Write rs("i") & " " & rs("d") & "
" rs.MoveNext Loop Set rs = Nothing Set sel = Nothing Set con = Nothing %> OK