Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : Why don't null fields get updated when using Signup · Login
Author Thread
Why don't null fields get updated when using
Posted in tutorial: Updating records in the database with ASP
·  Ruadh
User
Joined: 30 Aug 2003
Total Posts: 1

Why don't null fields get updated when using

Posted: 30 Aug 2003
I have a form/update page that works fine when I put data in the fields.
If there is data in the field already (and displayed in the form), then setting that field to null (taking the data out), has no effect.
Other changes to fields on that form happen but not these null fields.
Is this a known feature, or I am doing something wrong ?
Here's the relevant code:

.... validation code...

.... connect to Access database....

' 'Build the update string
strSQL = "Update Publications Set "
strSQL = strSQL & "[Publication Type] = '" & Request.Form("txtType") & "', "
strSQL = strSQL & "[Publication Title] = '" & Request.Form("txtTitle") & "', "


strSQL = strSQL & "[Publication County] = '" & Request.Form("txtCounty") & "', "



strSQL = strSQL & "[Publication Author] = '" & Request.Form("txtAuthor") & "', "



strSQL = strSQL & "[Publication Weight] = " & CLng(Request.Form("txtWeight")) & ", "
strSQL = strSQL & "[Publication Price] = " & CCur(Request.Form("txtPrice")) & ", "


strSQL = strSQL & "[Publication Notes] = '" & CStr(Request.Form("Notes2")) & "', "


strSQL = strSQL & "[Publication In Stock] = '" & CStr(Request.Form("txtInStock")) & "' "
strSQL = strSQL & " WHERE [Publication Id] = " & CLng(Request.Form("txtId")) & ";"

response.write "SQL s/m: " & strSQL

' 'Create the recordset object

'response.write "Step 3:" & strSQL
end if
Set oRSPublications = Server.CreateObject("ADODB.Recordset")
oRSPublications.CursorType = 2


oRSPublications.LockType = 3

'
'response.write "display update form: " & strSQL
'


conn.Execute(strSQL)

Want to leave a comment? Login or Register for free!

Users Who Have Visited This Thread In Last 24 Hours
2 Visitors

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.