I am writing a timepunch addition to an existing timecard web app using ASP and Internet Explorer tied to a SQL 7 backend. I have isolated enough of the problem down to what I think is trying to submit the statements without using the classic form/response schema. Here is a very dumbed down version of what I'm doing since I think the problem may be on a basic structural level (I hope). The SQL statements work and so does the button logic so I figure it must be structural.
vbscript,session variables and SQL connection and recordset stuff here
'sample of sql insert statement (not the real thing)
set sqlTimeIn = Server.CreateObject ("ADODB.Command")
sqlTimeIn.ActiveConnection = MM_timecardasp_STRING
sqlTimeIn.CommandText = "INSERT INTO dbo.tbltimepunchcard (SSN) VALUES ( ) "
sqlTimeIn.CommandType = 1
sqlTimeIn.CommandTimeout = 0
sqlTimeIn.Prepared = true
testpin = request.form("punchcard.onclick") 'button gets pushed
case TimeIn
sqlTimeIn.Execute()
case LunchOut
some sql update statement
case LunchIn
some sql update statement
case TimeOut
some sql update statement
End select
HTML stuff including body
some table data displayed from a recordset
<%
If punchtype <> "TimeIn" Then 'button value logic
If vLunchOut="" then 'default value is "TimeIn"
punchtype = "LunchOut" 'for no record
response.write "punchout"& punchtype
ElseIf vLunchIn="" and punchtype <> "TimeIn" then
punchtype = "LunchIn"
response.write "punchout"& punchtype
ElseIf vTimeOut="" and punchtype <> "TimeIn" then
punchtype = "TimeOut"
response.write "punchout"& punchtype
End If
End If
%>
<p align="center">
<label> 'this is the button that's suppose to trigger the SQL
<input name="timepunch" type="button" class="style29" id="timepunch" value=<%=punchtype%>/>
</label>
</p>
</body>
</html>
Nothing happens. I'm sure it's some kind of client side vs. server side error on my part. Please help.