Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    15

    Unanswered: help on an update...Please!

    hi, ive got a query which finds records for todays date, but what i would like to do is loop through all the records found and update a field in each record. what i have so far is the query. i would like it to update without submiting a form or anything, just by opening the page.
    thanks in advance.


    <%
    Dim deliveries__MMColParam
    deliveries__MMColParam = "0"
    If (strFinalDate <> "") Then
    deliveries__MMColParam = strFinalDate
    End If
    %>
    <%
    Dim deliveries__MMColParam1
    deliveries__MMColParam1 = "0"
    If (FormatDateTime(Now, 4) <> "") Then
    deliveries__MMColParam1 = FormatDateTime(Now, 4)
    End If
    %>
    <%
    Dim deliveries
    Dim deliveries_numRows

    Set deliveries = Server.CreateObject("ADODB.Recordset")
    deliveries.ActiveConnection = MM_ORGSchedularSQL_STRING
    deliveries.Source = "SELECT * FROM orgschedularsql.deliveries WHERE DateRequired = '" + Replace(deliveries__MMColParam, "'", "''") + "' and deliverytime < '" + Replace(deliveries__MMColParam1, "'", "''") + "'"
    deliveries.CursorType = 0
    deliveries.CursorLocation = 2
    deliveries.LockType = 1
    deliveries.Open()

    deliveries_numRows = 0
    %>

  2. #2
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Perhaps take a look at this:

    SQL The UPDATE Statement
    http://www.w3schools.com/sql/sql_update.asp
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  3. #3
    Join Date
    Jan 2004
    Posts
    15
    thats great thank you very much

  4. #4
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    You're welcome!
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •