If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > help on an update...Please!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-22-05, 08:56
rad0123 rad0123 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
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
%>
Reply With Quote
  #2 (permalink)  
Old 09-22-05, 14:45
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
  #3 (permalink)  
Old 09-23-05, 13:43
rad0123 rad0123 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
thats great thank you very much
Reply With Quote
  #4 (permalink)  
Old 09-23-05, 19:40
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On