Can anyone tell me why the code below won’t work. I’ve tested to make sure that it’s pulling the right record when the recordset is opened. I’ve made sure that the value is being pulled over from the form. I’ve even made sure that it’s updating the recordset object, but for some reason the rsCore.Update isn’t actually updating the database. I know the database can be written to, because there is other code on the page that is adding a new record to another table in the same database.
[code]
<%
Dim connDatabase
Dim rsCore
Dim strSelect
Dim strUID
strUID = Request.Form(“txtUID”)
Set connDatabase = Server.CreateObject(“ADODB.Connection”)
connDatabase.ConnectionString = “DSN=Database.dsn”
connDatabase.Open
Set rsCore = Server.CreateObject(“ADODB.Recordset”)
strSelect = “SELECT * FROM tblCore WHERE UID = ” & strUID
rsCore.Open strSelect, connDatabase, , adLockPessimistic
If Request.Form(“txtFirstName”) <> “” then
rsCore(“FirstName”) = Request.Form(“txtFirstName”)
Else
rsCore(“FirstName”) = Null
End If
rsCore.Update
rsCore.Close
Set rsCore = Nothing
connDatabase.Close
Set connDatabase = Nothing
%>