Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim objCommand
Dim objRS
Const adCmdText = &H0001
Set objCommand = Server.CreateObject("ADODB.Command")
Set objRS = Server.CreateObject("ADODB.RecordSet")
With objCommand
.ActiveConnection = "TableName"
.CommandType = adCmdText
End With
objCommand.CommandText = "DatabaseName"
objCommand.CommandType = 2
objRS.Open objCommand, , 2, 2
objRS.AddNew ' Add a new record
Response.Write "Got form... Processing...<br>"
For Each Field In Request.Form
Select Case objRS.Fields(Field).type
Case 200,201,202,203
' String
If Request.Form(Field) <> "" Then
strField = Request.Form(Field)
(Request.Form(Field),"'","''")
strField = Replace(Request.Form(Field),chr(34),""")
If strField <> "" Then
objRS.Fields(Field).value = strField
End If
End If ' Skip the blank ones
Case 11
' True or False
If Request.Form(Field) = "on" Then
objRS.Fields(Field).value = -1
Else
objRS.FIelds(Field).value = 0
End If
Case 3,2,5
' integer and number
' Response.Write "Integer/Number<br>"
If Request.Form(Field) <> "" Then
objRS.Fields(Field).value = Request.Form(Field)
End If ' Skip any blank ones
Case 135,133,134
' Date/Time Stamp
strDate = Request.Form(Field)
If strDate<>"" Then
objRS.Fields(Field).value = strDate
End If
Case else
Response.Write "Field type " & objRS.Fields(Field).type & "<br>"
Response.Write "Processing stopped.... unknown field type!"
Response.End
End Select
Next
objRS.Update()
Set objRS = Nothing
set objCommand = Nothing
Response.Write "Submitted!"