Avatar of Aleks
AleksFlag for United States of America

asked on 

Wrong data type

I created a recordset from a stored procedure, when I try to display the data it returns an error. I read its because the data type is incorrect. Below is my code, perhaps you can help me figure out which is incorrect. They are all int and two dates.

<%

Dim sp_reporting__Firmid
sp_reporting__Firmid = "0"
if(Session("Firmid") <> "") then sp_reporting__Firmid = Session("Firmid")

Dim sp_reporting__ContactStatus
sp_reporting__ContactStatus = "0"
if(Request.form("contactstatus") <> "") then sp_reporting__ContactStatus = Request.form("contactstatus")

Dim sp_reporting__Archivedcont
sp_reporting__Archivedcont = "0"
if(request.form("archivedcont")  <> "") then sp_reporting__Archivedcont = request.form("archivedcont") 

Dim sp_reporting__Age
sp_reporting__Age = "0"
if(request.form("age") <> "") then sp_reporting__Age = request.form("age")

Dim sp_reporting__Dobstart
sp_reporting__Dobstart = "01/01/1900"
if(request.form("age_start")  <> "") then sp_reporting__Dobstart = request.form("age_start") 

Dim sp_reporting__Dobend
sp_reporting__Dobend = "01/01/2050"
if(request.form("age_end") <> "") then sp_reporting__Dobend = request.form("age_end")

%>
<%

set sp_reporting = Server.CreateObject("ADODB.Command")
sp_reporting.ActiveConnection = MM_bluedot_STRING
sp_reporting.CommandText = "dbo.report_basic_contacts_04_results"
sp_reporting.CommandType = 4
sp_reporting.CommandTimeout = 0
sp_reporting.Prepared = true
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@RETURN_VALUE", 3, 4)
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@Firmid", 3, 1,4,sp_reporting__Firmid)
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@ContactStatus", 3, 1,4,sp_reporting__ContactStatus)
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@Archivedcont", 3, 1,4,sp_reporting__Archivedcont)
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@Age", 3, 1,4,sp_reporting__Age)
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@Dobstart", 7, 1,10,sp_reporting__Dobstart)
sp_reporting.Parameters.Append sp_reporting.CreateParameter("@Dobend", 7, 1,10,sp_reporting__Dobend)
set report_results = sp_reporting.Execute
report_results_numRows = 0

%>

Open in new window


Error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

[Microsoft][ODBC SQL Server Driver]Optional feature not implemented
ASPMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
Aleks
Avatar of Phil Davidson
Phil Davidson
Flag of United States of America image

Can age_end accept nulls?  Some of the parameters look like text and stored procedures.  I think there are data types beyond what you mentioned.  What are "two dates"?  Has it ever worked?  Are you sure the version of ASP you are using is compatible with SQL Server?  Is SQL Server configured to accept such interactions from the machine that has the ASP code?  Is there a way to re-write the ASP to have more done on the SQL server (e.g., with a script or stored procedure) and have a basic call to that code via ASP?  

I would try to use ASP with a simple connection string.  The error could be a misconfigured connection.  I would try the most simple ASP code to test connectivity.  With minimal data to insert, and you are trying to insert a variety of data, that could help isolate the problem. This problem could be that you are trying to load too much data via ASP.
Avatar of Aleks
Aleks
Flag of United States of America image

ASKER

Asp is fine. I have lots of pages connecting to the database. This particular report gives an error due to a wrong data type. I am pretty sure is the date format
ASKER CERTIFIED SOLUTION
Avatar of Aleks
Aleks
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Aleks
Aleks
Flag of United States of America image

ASKER

No other reply was correct
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo