Skip to main content
Inspiring
April 11, 2008
Question

ADODB.Command error '800a0d5d'

  • April 11, 2008
  • 3 replies
  • 9077 views
I am getting this error
ADODB.Command error '800a0d5d'

Application uses a value of the wrong type for the current operation
I am using an access database. I have checked my database and the parameters to ensure they are the date type. I thing it has someting to do with the length but Im not sure hoe to fix it. Here is my Query. I was also wondering what this meant "param2", 135, 1, -1, im not good with code nut eager to learn.
This topic has been closed for replies.

3 replies

Inspiring
April 12, 2008
Here is a sample from some of my code (vbscript) that works. See if
any of this helps.

Dim rs_Mresults__MMColParam1
rs_Mresults__MMColParam1 = "1/1/2007"
If (request.querystring("from_srch") <> "") Then
rs_Mresults__MMColParam1 = request.querystring("from_srch")
End If

rs_Mresults_cmd.CommandText = "SELECT top 50 m.last_name 'Last Name',
m.first_name 'First Name', s.Description 'Membership Type', t.type_desc
'Member Type', cast(datepart(month, c.approved_dt) as
varchar)+'/'+cast(datepart(day,c.approved_dt)as
varchar)+'/'+cast(datepart(year,c.approved_dt)as varchar) Approved,
c.cert FROM certificates c, members m, member_type t, statuses s WHERE
c.cert = m.cert and c.status = s.status and m.mem_type = t.mem_type and
((c. Approved_dt >= ?) and (c.Approved_dt <= ?)) ORDER BY
c.Approved_dt, c.cert, m.mem_type"
rs_Mresults_cmd.Prepared = true
rs_Mresults_cmd.Parameters.Append
rs_Mresults_cmd.CreateParameter("param1", 135, 1, -1,
rs_Mresults__MMColParam1) ' adDBTimeStamp
rs_Mresults_cmd.Parameters.Append
rs_Mresults_cmd.CreateParameter("param2", 135, 1, -1,
rs_Mresults__MMColParam2) ' adDBTimeStamp


I generally do date testing in the form before passing the value.


--

lands1ideAuthor
Inspiring
April 11, 2008
Thanks for the link that was very helpful. I have been looking for that info for some time. I still can get it to accept my dates I tried to change this
var Recordset1__MMColParam = "1999/01/31";
if (String(Request.Form("stdate")) != "undefined" &&
String(Request.Form("stdate")) != "") {
Recordset1__MMColParam = String(Request.Form("stdate"));
}
%>
<%
var Recordset1__MMColend = "9999/01/31";
but with no luck. Any other idea's
Inspiring
April 11, 2008
it could be the way you are testing the value and the 1 and 100 are
dropping thru and they are invalid dates. I had this problem once and
to test what I said said I replace the numeric values with date values
and found that my testing was faulty.

Google createparamater and you get this link
http://www.w3schools.com/ado/met_comm_createparameter.asp that explains
what 135 refers to. You may want 133.

lands1ide wrote:

> I am getting this error
> ADODB.Command error '800a0d5d'
>
> Application uses a value of the wrong type for the current operation
> I am using an access database. I have checked my database and the
> parameters to ensure they are the date type. I thing it has someting
> to do with the length but Im not sure hoe to fix it. Here is my
> Query. I was also wondering what this meant "param2", 135, 1, -1, im
> not good with code nut eager to learn.
>
>
> <!--#include file="../../../Connections/DenQuality1.asp" -->
> <%
> var Recordset1__MMColParam = "1";
> if (String(Request.Form("stdate")) != "undefined" &&
> String(Request.Form("stdate")) != "") {
> Recordset1__MMColParam = String(Request.Form("stdate"));
> }
> %>
> <%
> var Recordset1__MMColend = "100";
> if (String(Request.Form("enddate")) != "undefined" &&
> String(Request.Form("enddate")) != "") {
> Recordset1__MMColend = String(Request.Form("enddate"));
> }
> %>
> <%
> var Recordset1_cmd = Server.CreateObject ("ADODB.Command");
> Recordset1_cmd.ActiveConnection = MM_DenQuality1_STRING;
> Recordset1_cmd.CommandText = "SELECT * FROM Nikki WHERE [Date
> Reviewed] BETWEEN ? AND ?";
> Recordset1_cmd.Prepared = true;
>
> Recordset1_cmd.Parameters.Append(Recordset1_cmd.CreateParameter("param
> 1", 135, 1, -1, Recordset1__MMColParam)); // adDBTimeStamp
> Recordset1_cmd.Parameters.Append(Recordset1_cmd.CreateParameter("param
> 2", 135, 1, -1, Recordset1__MMColend)); // adDBTimeStamp
>
> var Recordset1 = Recordset1_cmd.Execute();
> var Recordset1_numRows = 0;
> %>
> <%
> var Repeat1__numRows = -1;
> var Repeat1__index = 0;
> Recordset1_numRows += Repeat1__numRows;
> %>



--