Insert record at start of database

Discussion in 'C#' started by Supremus, Oct 11, 2006.

  1. #1
    I need to insert a record into the start of a recordset called hits. AddNew adds it to the end I think.

    The first field is "StartDate" and it needs to have the value of the current date. Do I have to list all the other fields that have a default 0 value


    if month(date) <> month(rs.fields("startdate").value) then
    rs.execute "INSERT INTO hits "
    rs.fields(StartDate) = " & date
    rs.update
    end if
     
    Supremus, Oct 11, 2006 IP
  2. Froggie

    Froggie Well-Known Member

    Messages:
    665
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    120
    #2
    why not just have them other fields default to an previous date and put the records you want first with current dates and just use ORDER BY clause to sort them in any way u want.
     
    Froggie, Oct 12, 2006 IP