Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Problem with update statement

Problem with update statement

Scheduled Pinned Locked Moved Database
databasehelpsysadminannouncementcareer
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matjame
    wrote on last edited by
    #1

    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 select

    kagiso

    M 1 Reply Last reply
    0
    • M matjame

      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 select

      kagiso

      M Offline
      M Offline
      matjame
      wrote on last edited by
      #2

      This site is working fine from the server and on the computer(Local host), so I only copied the files across to the ftp folder of the web hosting company and the problem begun. What should I do?? Thanx in advance.

      kagiso

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups