I have a page that passes a variables as a string to a second page. The second page uses the following code to execute a stored procedure which parses the string data, and forms a select statement out of it.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/svrsql.asp" -->
<%
Dim Command1__BuildingID
Command1__BuildingID = ""
if(Request.QueryString("BuildingID" <> "" then Command1__BuildingID = Request.QueryString("BuildingID"
Dim Command1__StartDate
Command1__StartDate = "200302"
if(Request.QueryString("StartDate" <> "" then Command1__StartDate = Request.QueryString("StartDate"
Dim Command1__EndDate
Command1__EndDate = "200306"
if(Request.QueryString("EndDate" <> "" then Command1__EndDate = Request.QueryString("EndDate"
%>
<%
set Command1 = Server.CreateObject("ADODB.Command"
Command1.ActiveConnection = MM_svrsql_STRING
Command1.CommandText = "MRI_USER.sp_viiGetCashFlowAccounts2"
Command1.Parameters.Append Command1.CreateParameter("@RETURN_VALUE", 3, 4)
Command1.Parameters.Append Command1.CreateParameter("@BuildingID", 200, 1,100,Command1__BuildingID)
Command1.Parameters.Append Command1.CreateParameter("@StartDate", 129, 1,6,Command1__StartDate)
Command1.Parameters.Append Command1.CreateParameter("@EndDate", 129, 1,6,Command1__EndDate)
Command1.CommandType = 4
Command1.CommandTimeout = 0
Command1.Prepared = true
set rsData = Command1.Execute
rsData_numRows = 0
%>
I know the stored procedure is working correctly because when I run it in SQL query analyzer, it works perfectly. Also, my second page works correctly when I only pass 1 item in the string. It's only when I try to pass more than 1 item via the string (i.e. 'Building1,Building2'), that I get an error. The error I am recieving is:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
/custommri/CashFlowsCalcBeta.asp, line 30
Note: Line 30 is the line with set rsData = Command1.Execute on it. My question is, why is the data being truncated? ...and how can I keep it from being truncated?
Thanks,
Josh
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/svrsql.asp" -->
<%
Dim Command1__BuildingID
Command1__BuildingID = ""
if(Request.QueryString("BuildingID" <> "" then Command1__BuildingID = Request.QueryString("BuildingID"
Dim Command1__StartDate
Command1__StartDate = "200302"
if(Request.QueryString("StartDate" <> "" then Command1__StartDate = Request.QueryString("StartDate"
Dim Command1__EndDate
Command1__EndDate = "200306"
if(Request.QueryString("EndDate" <> "" then Command1__EndDate = Request.QueryString("EndDate"
%>
<%
set Command1 = Server.CreateObject("ADODB.Command"
Command1.ActiveConnection = MM_svrsql_STRING
Command1.CommandText = "MRI_USER.sp_viiGetCashFlowAccounts2"
Command1.Parameters.Append Command1.CreateParameter("@RETURN_VALUE", 3, 4)
Command1.Parameters.Append Command1.CreateParameter("@BuildingID", 200, 1,100,Command1__BuildingID)
Command1.Parameters.Append Command1.CreateParameter("@StartDate", 129, 1,6,Command1__StartDate)
Command1.Parameters.Append Command1.CreateParameter("@EndDate", 129, 1,6,Command1__EndDate)
Command1.CommandType = 4
Command1.CommandTimeout = 0
Command1.Prepared = true
set rsData = Command1.Execute
rsData_numRows = 0
%>
I know the stored procedure is working correctly because when I run it in SQL query analyzer, it works perfectly. Also, my second page works correctly when I only pass 1 item in the string. It's only when I try to pass more than 1 item via the string (i.e. 'Building1,Building2'), that I get an error. The error I am recieving is:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
/custommri/CashFlowsCalcBeta.asp, line 30
Note: Line 30 is the line with set rsData = Command1.Execute on it. My question is, why is the data being truncated? ...and how can I keep it from being truncated?
Thanks,
Josh