I have an access database. I set all fields to "not required" and "allow zero length". However, when the form fields are empty, my SQL statement runs into an error. How do I code it so that it "understands" that null is the value being entered. Currently, I'm using this:
Dim minamt = Request.Form("amt"
Dim intVID = Request.Form("vid"
set objRS = Server.CreateObject("ADODB.Recordset"
strSQL = "UPDATE tblLoans SET " & _
"MinAmount = " & Minamt & _
"WHERE vid = " & intVID
objRS.Open strSQL, strConn, adOpenDynamic, adLockPessimistic
'objRS.close
set objRS = nothing
It works as long as long as I enter something into the form fields. If nothing is entered into the "amt" field, the strSQL is parsed as "UPDATE tblLoans SET MinAmount = WHERE vid = [somenumber]" which obviously causes an error. How do I get around this?
Dim minamt = Request.Form("amt"
Dim intVID = Request.Form("vid"
set objRS = Server.CreateObject("ADODB.Recordset"
strSQL = "UPDATE tblLoans SET " & _
"MinAmount = " & Minamt & _
"WHERE vid = " & intVID
objRS.Open strSQL, strConn, adOpenDynamic, adLockPessimistic
'objRS.close
set objRS = nothing
It works as long as long as I enter something into the form fields. If nothing is entered into the "amt" field, the strSQL is parsed as "UPDATE tblLoans SET MinAmount = WHERE vid = [somenumber]" which obviously causes an error. How do I get around this?