Object required question

Results 1 to 2 of 2

Thread: Object required question

  1. #1
    Join Date
    Dec 1969

    Default Object required question

    I have this asp code, and the error that I am getting is <BR>Microsoft VBScript runtime error &#039;800a01a8&#039; <BR><BR>Object required: &#039;Select UserID from c&#039; <BR><BR>/timesheet/updateclockin1.asp, line 50 <BR><BR>I have been looking at it for hours and cannot figue it out. Please let me know what I am missing. <BR>Thanks,<BR>Petra.<BR>&#060;%<BR><BR>dim conn<BR>dim rs<BR>dim strconn<BR>dim strsql<BR>Dim clockin<BR>Dim clockinDate<BR><BR>Dim rsCheck<BR><BR>clockin = (DateAdd("h","-1", Time))<BR><BR><BR>clockindate = Date() <BR><BR>dim UserID<BR><BR><BR>UserId = Session("UserId") <BR><BR><BR><BR><BR>strsql = ""<BR><BR>strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("/TimeSheet/timesheet.mdb")<BR><BR><BR><BR>strSQL = "INSERT INTO clockin (UserID, clockin, clockindate) VALUES(&#039;" & UserID & "&#039;,&#039;" & clockin & "&#039;, &#039;" & clockindate & "&#039;)" <BR> <BR><BR>Response.Write strSQL & "" <BR><BR>rsCheck = "Select UserID from clockin where UserID = " & UserID & " And ClockinDate = clockindate" <BR><BR>IF rsCheck.EOF Then <BR>Response.Write "you have tolog in"<BR><BR>Else <BR>Response.Write "YOu have already clocked in"<BR><BR>End if <BR> <BR><BR><BR>set conn = server.createobject("adodb.connection")<BR>conn.op en strconn<BR><BR><BR><BR>conn.execute(strSQL)<BR>con n.execute(rsCheck)<BR>conn.close<BR>set conn = nothing<BR><BR><BR><BR>Response.Redirect "index.asp"<BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969
    Indianapolis, IN

    Default RE: Object required question

    You can&#039;t just set a recordset equal to a string. I would suggest using the conn.execute as you did below and assigning the recordset to that. Check the ASPFAQ&#039;s for more information on using a recordset.

Posting Permissions

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