Problem with SQLserver and updating recordset
-
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
-
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
Try:
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnectoConn.Execute "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", , adExecuteNoRecords Or adCmdText
objConn.Close
Set objConn = Nothing