Anthony1312002
Programmer
Does anyone remember how to post to a checkbox field? In Access the field value is Yes/No. I've tried using Request.Form instead of CleanInput but with no success.
Here is how I'm trying to do it but I'm getting a datatype mismatch in criteria error:
Option Explicit
Function CleanInput(strReqName)
CleanInput = Replace(Request.Form(strReqName),"'","''")
End Function
Dim sql_update, Conn, sql_users, rs_users, cmdDC, str_Times, str_EComments, str_OneToTwo
Set Conn = Server.CreateObject ("ADODB.Connection")
Set sql_users = Server.CreateObject ("ADODB.Recordset")
conn.open "RemitcoDSN"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = Conn
sql_users = "SELECT * FROM tblShiftTurnover"
Set rs_users = conn.Execute(sql_users)
str_OneToTwo = CleanInput("1To2_YN")
str_Times = CleanInput("Time_n")
str_EComments = CleanInput("txtExtractCommenta")
sql_update = "INSERT INTO tblShiftTurnover(OneToTwo,ShiftTime,E_Comments)" & _
"VALUES('" & str_OneToTwo & "','" & str_Times & "','" & str_EComments & "')"
Conn.Execute sql_update
Response.Redirect "ShiftTurnover.asp"
Here is how I'm trying to do it but I'm getting a datatype mismatch in criteria error:
Option Explicit
Function CleanInput(strReqName)
CleanInput = Replace(Request.Form(strReqName),"'","''")
End Function
Dim sql_update, Conn, sql_users, rs_users, cmdDC, str_Times, str_EComments, str_OneToTwo
Set Conn = Server.CreateObject ("ADODB.Connection")
Set sql_users = Server.CreateObject ("ADODB.Recordset")
conn.open "RemitcoDSN"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = Conn
sql_users = "SELECT * FROM tblShiftTurnover"
Set rs_users = conn.Execute(sql_users)
str_OneToTwo = CleanInput("1To2_YN")
str_Times = CleanInput("Time_n")
str_EComments = CleanInput("txtExtractCommenta")
sql_update = "INSERT INTO tblShiftTurnover(OneToTwo,ShiftTime,E_Comments)" & _
"VALUES('" & str_OneToTwo & "','" & str_Times & "','" & str_EComments & "')"
Conn.Execute sql_update
Response.Redirect "ShiftTurnover.asp"