adding a record with stored procedure and getting

Results 1 to 2 of 2

Thread: adding a record with stored procedure and getting

  1. #1
    Join Date
    Dec 1969

    Default adding a record with stored procedure and getting

    any ideas why i get the follwing error?<BR><BR>here is my sproc:<BR><BR><BR>/****** Stored Procedure sp_create_error ******/<BR>/*<BR>** inserts values into a new error<BR> called by<BR> EXECUTE sp_create_error <BR> @Page_Name = testasp,<BR> @Project_Id = 1,<BR> @Assigned_To = 1,<BR> @Priority_Id = 1,<BR> @Error_Catagory = 1,<BR> @Error_Status = 1,<BR> @Created_By = 3,<BR> @Modified_By = 2,<BR> @Error_Name = &#039Test&#039,<BR> @Error_Detail = &#039This is a long Description&#039,<BR> @Browser_Type = IE,<BR> @Browser_Version = new,<BR> @Operating_System = Windows,<BR> @Error_Id = @@IDENTITY;<BR>*/<BR>CREATE PROCEDURE sp_create_error<BR> @Page_Name Varchar (50),<BR> @Project_Id Int,<BR> @Assigned_To Int,<BR> @Priority_Id Int,<BR> @Error_Catagory Int,<BR> @Error_Status Int,<BR> @Created_By Int,<BR> @Modified_By Int,<BR> @Error_Name Varchar (80),<BR> @Error_Detail Varchar (8000),<BR> @Browser_Type Varchar (50),<BR> @Browser_Version Varchar (50),<BR> @Operating_System Varchar (50),<BR> @Error_Id Int OUTPUT <BR><BR>AS<BR>INSERT INTO ERRORS (Page_Name, Project_Id, Assigned_To, Priority_Id, Error_Catagory, Error_Status, Created_By, Modified_By, <BR>Error_Name, Error_Detail, Browser_Type, Browser_Version, Operating_System )<BR>Values (@Page_Name, <BR> @Project_Id,<BR> @Assigned_To,<BR> @Priority_Id,<BR> @Error_Catagory,<BR> @Error_Status, <BR> @Created_By,<BR> @Modified_By, <BR> @Error_Name, <BR> @Error_Detail,<BR> @Browser_Type,<BR> @Browser_Version,<BR> @Operating_System<BR> ) <BR> <BR>SELECT @Error_Id = (Select Error_Id FROM ERRORS where Error_ID = @@IDENTITY)<BR><BR>GO<BR><BR>HERE is how im calling it:<BR><BR>sub adderror2()<BR> Dim cmdError<BR> Dim lRecs<BR> Dim lAAdded<BR> Dim ivpagename, ivprojId, iverrorcategory, iverrorstatus, ivcreatedby, ivmodifiedby, iverrorname, iverrordetail, ivbrowser, ivbrowserversion, ivoperatingsystem, iverrorid<BR><BR> Set cmdError = Server.CreateObject("ADODB.Command")<BR><BR> With cmdError<BR> .ActiveConnection = strConn<BR> .CommandText = "sp_create_error"<BR> .CommandType = adCmdStoredProc<BR> &#039set variables<BR> ivpagename = trim(Replace(Request.Form("pagename"),"&#039","&#0 39&#039"))<BR> ivprojId = 3 <BR> ivassignedto = Request.Form("assignedto")<BR> ivpriority = Request.Form("priority") <BR> iverrorcatagory = Request.Form("category") <BR> iverrorstatus = Request.Form("errorstatus")<BR> ivcreatedby = Request.Cookies("User_Id")<BR> ivmodifiedby = Request.Cookies("User_Id")<BR> iverrorname = Trim(Replace(Request.Form("summary"), "&#039","&#039&#039"))<BR> iverrordetail = Trim(Replace(Request.Form("description"), "&#039","&#039&#039"))<BR> ivbrowser = Request.Form("browser")<BR> ivbrowserversion = Request.Form("version")<BR> ivoperatingsystem = Request.Form("opsyst")<BR> iverrorid = "@@IDENTITY;"<BR> <BR> &#039 create the parameters<BR> .Parameters.Append .CreateParameter ("@PageName", adVarWChar, adParamInput, 50, ivpagename)<BR> .Parameters.Append .CreateParameter ("@Project_Id", adInteger, adParamInput,, ivprojId)<BR> .Parameters.Append .CreateParameter ("@Assigned_To", adInteger, adParamInput,, ivassignedto)<BR> .Parameters.Append .CreateParameter ("@Priority_Id", adInteger, adParamInput,, ivpriority)<BR> .Parameters.Append .CreateParameter ("@Error_Catagory", adInteger, adParamInput,, iverrorcatagory)<BR> .Parameters.Append .CreateParameter ("@Error_Status", adInteger, adParamInput,, iverrorstatus)<BR> .Parameters.Append .CreateParameter ("@Created_By", adInteger, adParamInput,, ivcreatedby)<BR> .Parameters.Append .CreateParameter ("@Modified_By", adInteger, adParamInput,, ivmodifiedby) <BR> .Parameters.Append .CreateParameter ("@Error_Name", adVarWChar, adParamInput, 80, iverrorname)<BR> .Parameters.Append .CreateParameter ("@Error_Detail",adVarWChar, adParamInput, 8000, iverrordetail)<BR> .Parameters.Append .CreateParameter ("@Browser_Type", adVarWChar, adParamInput, 50, ivbrowser)<BR> .Parameters.Append .CreateParameter ("@Browser_Version", adVarWChar, adParamInput, 50, ivbrowserversion)<BR> .Parameters.Append .CreateParameter ("@Operating_System", adVarWChar, adParamInput, 50, ivoperatingsystem)<BR> .Parameters.Append .CreateParameter ("@Error_Id", adInteger,, adParamOutput)<BR> &#039execute the command<BR> .Execute lRecs, , adExecuteNoRecords<BR> <BR> lAAdded = .Parameters("@Error_Id")<BR> End With<BR> Response.Write lRecs & "New error(s) added, ID:&#060;P&#062;" & lAdded<BR> Set cmdError = Nothing<BR>end sub<BR>

  2. #2
    patricklocke Guest

    Default here's the error i get

    Error Type:<BR>Microsoft OLE DB Provider for SQL Server (0x80040E14)<BR>Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts