I am trying to save a date to a SQL table using a parameterised query in ASP classic.
The field is set to type date and I have tried things like
Set sqlParameters(0)=cmdCreateParameterObj.CreateParameter("@DocDate", adDbDate, adParamInput, , "20160928")
The error I get is
Application uses a value of the wrong type for the current operation.
I have tried changing adDbDate to other things but no luck so far.
Any ideas?
Edit - this is the function I call which appends all of my parameters stored in the array:
Function executeSQL(sqlQuery, allParameters)
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = DB
cmd.CommandText = sqlQuery
cmd.CommandType = adCmdText
cmd.NamedParameters = true
cmd.Prepared = true
For p=0 To UBOUND(AllParameters)
cmd.Parameters.Append AllParameters(p)
Next
Set TBL=cmd.Execute()
Set cmd=Nothing
End Function