Question : SQL INSERT - how to avoid this error: Parameter ?_1 has no default value.

Hi Experts,
I'm trying to insert some data in my table, but I keep getting this error message. Would you please let me know what the problem is?
Thank you
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
strSubject = request.Form("Subject")
strNightDate = request.Form("NightDate")
strPersonAddedOn = request.Form("PersonAddedOn")
strComputerName = request.Form("ComputerName")
strLoggedBy = request.Form("LoggedBy")
strAllNights = request.Form("AllNights")

'create connection object
Set MesIns=CreateObject("ADODB.Command")
MesIns.ActiveConnection=objConn
MesIns.commandtext = "insert into Nightly_Table (Subject, PersonAddedOn, NightDate, ComputerName, LoggedBy, AllNights) VALUES (?,?,?,?,?,?)"
MesIns.Parameters.Append MesIns.CreateParameter("@Subject", 200, 1, 255, strSubject)
MesIns.Parameters.Append MesIns.CreateParameter("@PersonAddedOn", 200, 1, 255, strPersonAddedOn)
MesIns.Parameters.Append MesIns.CreateParameter("@NightDate", 200, 1, 255, strNightDate)
MesIns.Parameters.Append MesIns.CreateParameter("@ComputerName", 200, 1, 255, strComputerName)
MesIns.Parameters.Append MesIns.CreateParameter("@LoggedBy", 200, 1, 255, strLoggedBy)
MesIns.Parameters.Append MesIns.CreateParameter("@AllNights", 200, 1, 255, strAllNights)
MesIns.Execute

Answer : SQL INSERT - how to avoid this error: Parameter ?_1 has no default value.

I guess first you have to define "US Federal Holidays" ...
Like, Easter ?  Always a different day.

July 4th ... easy, lol.

Why not set up a user table with simple maintenance form ... which allows the holidays to be populated each year.

This goes to 2020:

http://www.opm.gov/Operating_Status_Schedules/fedhol/2010.asp

mx
Random Solutions  
 
programming4us programming4us