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 > Update single MSAccess record from ASP form

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-24-04, 20:04
TimCs TimCs is offline
Registered User
 
Join Date: Nov 2004
Location: Calif
Posts: 1
Question Update single MSAccess record from ASP form

I have an ASP form (VBScript) that lists Appointment slots (there are several of the same time but I use a summing query to list just one each) and people who need to schedule themselves in. When all slots are full, that time is filtered out. When the user selects their name and Appt Slot and clicks Submit, I want to update one record of the Appt table with the ID of the person. I tried a SELECT that returns multiple fields but I can't edit/update the UserID. UPDATE doesn't accept a [TOP 1] parameter.

Code:
  qryCheckPre = "SELECT [OpenSlots].[TimeStart], [OpenSlots].[TestSlot], [OpenSlots].[Location], [OpenSlots].[TimeLoc] "
  qryCheckPre = qryCheckPre + "FROM [OpenSlots] "
  qryCheckPre = qryCheckPre + "WHERE ([OpenSlots].[TimeLoc] = '"
  qryCheck = qryCheckPre + tmpTime + " - " + tmpLoc + "'); "
  Set WriteRS = Server.CreateObject("ADODB.Recordset")
  WriteRS.Open qryCheck, FitTestDB, adOpenForwardOnly, adLockOptimistic, adCmdText
    WriteRS.Edit
    WriteRS("UserID") = tmpUserID
    WriteRS("Submit") = Now
    WriteRS.Update
    WriteRS.Close
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