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 SQLserver and updating recordset

Problem with SQLserver and updating recordset

Scheduled Pinned Locked Moved Database
helpsysadminannouncement
2 Posts 2 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.
  • G Offline
    G Offline
    Garth
    wrote on last edited by
    #1

    I am trying to update an existing record in a table using the following code in an ASP page. The table (tblProjectCats) has an ID value (integer, autoincrement), and Title and Description fields (both set to varchar). The following code just doesn't work...doesn't give an error message... '//start code Dim objConn, objRS Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open strConnect Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", objConn, adOpenDynamic, adLockReadOnly, adCmdText objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing '//end code

    Richard DeemingR 1 Reply Last reply
    0
    • G Garth

      I am trying to update an existing record in a table using the following code in an ASP page. The table (tblProjectCats) has an ID value (integer, autoincrement), and Title and Description fields (both set to varchar). The following code just doesn't work...doesn't give an error message... '//start code Dim objConn, objRS Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open strConnect Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", objConn, adOpenDynamic, adLockReadOnly, adCmdText objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing '//end code

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Try:

      Dim objConn
      Set objConn = Server.CreateObject("ADODB.Connection")
      objConn.Open strConnect

      oConn.Execute "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", , adExecuteNoRecords Or adCmdText

      objConn.Close
      Set objConn = Nothing

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      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