Problem with update statement
-
Hello there guys. Im experiencing a problem with an update statement and this is the error I get when trying to log into my website. Error Occured: Error # -2147467259 Operation must use an updateable query. SQL = UPDATE tbl_employees SET lastlogin = #28-Feb-2008# WHERE employeelogin = 'SIPHOSIBUYANE' I tried to check the permission(They are correct), files(They are in the right places).Now I dont knw what could be the problem. Here is the update statement. Private function RunSQL(ByVal sql,ByRef myRS) 'Response.Write sql & "
" On Error Resume Next if lcase(left(trim(sql),6)) = "select" then set myRS = server.CreateObject("adodb.recordset") myRS.open sql,conn,3,3 else select case lcase(left(trim(sql),6)) case "update", "delete" if instr(lcase(sql),"where") = 0 then response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!" boolDoNotRunQuery = true response.end end if end select if boolDoNotRunQuery <> true then set myRS = conn.Execute(sql) end if end if if err.number <> 0 then Response.Clear Response.Write "Error Occured:" Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & "
" Response.Write "SQL = " & sql & "
" Response.End End if On Error Goto 0 end Function Private function DoSQL(ByVal sql) 'Response.write sql & "
" On Error Resume Next boolDoNotRunQuery = FALSE actionWord = left(trim(sql),6) select case lcase(actionWord) case "update", "delete" if instr(lcase(sql),"where") = 0 then response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!" boolDoNotRunQuery = true response.end end if end selectkagiso
-
Hello there guys. Im experiencing a problem with an update statement and this is the error I get when trying to log into my website. Error Occured: Error # -2147467259 Operation must use an updateable query. SQL = UPDATE tbl_employees SET lastlogin = #28-Feb-2008# WHERE employeelogin = 'SIPHOSIBUYANE' I tried to check the permission(They are correct), files(They are in the right places).Now I dont knw what could be the problem. Here is the update statement. Private function RunSQL(ByVal sql,ByRef myRS) 'Response.Write sql & "
" On Error Resume Next if lcase(left(trim(sql),6)) = "select" then set myRS = server.CreateObject("adodb.recordset") myRS.open sql,conn,3,3 else select case lcase(left(trim(sql),6)) case "update", "delete" if instr(lcase(sql),"where") = 0 then response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!" boolDoNotRunQuery = true response.end end if end select if boolDoNotRunQuery <> true then set myRS = conn.Execute(sql) end if end if if err.number <> 0 then Response.Clear Response.Write "Error Occured:" Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & "
" Response.Write "SQL = " & sql & "
" Response.End End if On Error Goto 0 end Function Private function DoSQL(ByVal sql) 'Response.write sql & "
" On Error Resume Next boolDoNotRunQuery = FALSE actionWord = left(trim(sql),6) select case lcase(actionWord) case "update", "delete" if instr(lcase(sql),"where") = 0 then response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!" boolDoNotRunQuery = true response.end end if end selectkagiso