Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

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

Avatar of baxtalo
baxtalo asked on
7 Comments1 Solution281 ViewsLast Modified:
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
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.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)