JohnnyPolite
MIS
Hello,
I am using multiple update commands on my site and I am not sure how to deal with zero length strings. I am sure you check the length, but I can't sort it out in my head how to do it. I have many fields in each update command so I was thinking I could set up a function.
To be honest, I am very new at ASP VBScript. I am halfway decent at VBA, but for some reason I can't wrap my head around this. I will post one of my update commands to give you an idea of how many fields are in one command.
If there is a more efficient way to write this command, I wouldn't be sad if someone helped me with that as well. StuID is a hidden field that I am passing from page to page as the index.
I appreciate any help. Thanks in advance!
-JP
I am using multiple update commands on my site and I am not sure how to deal with zero length strings. I am sure you check the length, but I can't sort it out in my head how to do it. I have many fields in each update command so I was thinking I could set up a function.
To be honest, I am very new at ASP VBScript. I am halfway decent at VBA, but for some reason I can't wrap my head around this. I will post one of my update commands to give you an idea of how many fields are in one command.
Code:
"UPDATE tblStudentContacts SET MomFstName = '" & Request.Form("MomFstName") & "', MomLstName = '" & Request.Form("MomLstName") & _
"', MomGuard = '" & Request.Form("grpMomGuard") & "', MomAdd = '" & Request.Form("MomAdd") & "', MomAdd2 = '" & Request.Form("MomAdd2") & "', MomCity = '" & Request.Form("MomCity") & "'," & _
" MomSt = '" & Request.Form("MomSt") & "', MomZip = '" & Request.Form("MomZip") & "', MomHomePh = '" & Request.Form("MomHomePh") & "', " & _
"MomWorkPh = '" & Request.Form("MomWorkPh") & "', MomCellPh = '" & Request.Form("MomCellPh") & "', MomEmail = '" & Request.Form("MomEmail") & "', " & _
"DadFstName = '" & Request.Form("DadFstName") & "', DadLstName = '" & Request.Form("DadLstName") & "', DadGuard = '" & Request.Form("grpDadGuard") & "', " & _
"DadAdd = '" & Request.Form("DadAdd") & "', DadAdd2 = '" & Request.Form("DadAdd2") & "', DadCity = '" & Request.Form("DadCity") & "', DadSt = '" & Request.Form("DadSt") & "', " & _
"DadZip = '" & Request.Form("DadZip") & "', DadHomePh = '" & Request.Form("DadHomePh") & "', DadWorkPh = '" & Request.Form("DadWorkPh") & "', " & _
"DadCellPh = '" & Request.Form("DadCellPh") & "', DadEmail = '" & Request.Form("DadEmail") & "' WHERE StuID = " & Request.Form("StuID")
If there is a more efficient way to write this command, I wouldn't be sad if someone helped me with that as well. StuID is a hidden field that I am passing from page to page as the index.
I appreciate any help. Thanks in advance!
-JP