Hi currently i have a sub with that has a few of these lines:
strChiropractor = Trim(Request.Form("Chiropractor"))
strDentist = Trim(Request.Form("Dentist"))
//////it also has a few of these in the same sub right after:
I was hoping to have fun with this and make it more dynamic, this is what i have so far, assistance is need to understand further, any suggestions?
strChiropractor = Trim(Request.Form("Chiropractor"))
strDentist = Trim(Request.Form("Dentist"))
//////it also has a few of these in the same sub right after:
Code:
'Chiropractor
strSql = "UPDATE NotValidatedMessage" _
& " SET Message = '" & Replace(strChiropractor, "'", "''") & "'" _
& " WHERE ProfessionID = 23"
gobjConn.Execute(strSql)
' Dentist
strSql = "UPDATE NotValidatedMessage" _
& " SET Message = '" & Replace(strDentist, "'", "''") & "'" _
& " WHERE ProfessionID = 14"
gobjConn.Execute(strSql)
End Sub
I was hoping to have fun with this and make it more dynamic, this is what i have so far, assistance is need to understand further, any suggestions?
Code:
Dim thing
For Each thing In Request.Form
Response.Write "str & thing & " = " & "Trim(Request" & thing & "")) & vbCrLf
strSql =" &" UPDATE NotValidatedMessage" _
& " SET Message = '" & Replace(str"'&thing&'", "'", "''") & "'" _
& " WHERE ProfessionID = " & NewVar 'NewVar is the profession ID number
gobjConn.Execute(strSql)
Next