Ask a Question related to Coldfusion Database Access, Design and Development.
-
SuperDud #1
Value can not be converted to requested type.
Having a peculiar problem running a MS-SQL 2000 Stored Procedure in CFMX6.1.
SP works perfectly in Query Analyzer and has the right permissions for the web
DSN to execute it. However I keep getting [Macromedia][SQLServer JDBC
Driver]Value can not be converted to requested type. on the last CFPROCPARAM
line when I try and run it in CF. Google on this phrase yields a MS-SQL issue
with non-null properties of fields in the DB. I have gone back and changed all
my fields to accept null values. That has not solved the problem. Am I doing
something stupid? Any insight would be much appreciated. Thanks. S Code
snippets attached..
Stored Procedure
=============
CREATE PROCEDURE sp_InsertNewUser
@txtFName varchar(50),
@txtLName varchar(50),
@txtUserName varchar(50),
@txtPassword varchar(50),
@txtEmail varchar(50),
@txtCode varchar(50),
@intSchoolID int,
@intUserID int OUTPUT
AS
INSERT INTO tblUser (txtFName, txtLName, txtUserName, txtPassword, txtEmail,
intSchoolID, txtCode)
VALUES (@txtFName, @txtLName, @txtUserName, @txtPassword, @txtEmail,
@intSchoolID, @txtCode)
SELECT @intUserID = @@IDENTITY
GO
Code snippet
===========
<cfstoredproc datasource="#DSN#" procedure="sp_InsertNewUser"
returncode="Yes">
<cfprocparam cfsqltype="CF_SQL_CHAR" dbvarname="txtFName"
value="#form.txtFName#" type="In">
<cfprocparam cfsqltype="CF_SQL_CHAR" dbvarname="txtLName"
value="#form.txtLName#" type="In">
<cfprocparam cfsqltype="CF_SQL_CHAR" dbvarname="txtUserName"
value="#form.txtUserName#" type="In">
<cfprocparam cfsqltype="CF_SQL_CHAR" dbvarname="txtPassword"
value="#form.txtPassword1#" type="In">
<cfprocparam cfsqltype="CF_SQL_CHAR" dbvarname="txtEmail"
value="#form.txtEmail#" type="In">
<cfprocparam cfsqltype="CF_SQL_CHAR" dbvarname="txtCode"
value="#form.txtCode#" type="In">
<cfprocparam cfsqltype="CF_SQL_INTEGER" dbvarname="intSchoolID"
value="#form.intSchoolID#" type="In">
<cfprocparam cfsqltype="CF_SQL_INTEGER" dbvarname="intUserID"
variable="intUserID" type="Out">
</cfstoredproc>
SuperDud Guest
-
Object of type 'System.String' cannot be converted to type 'System
I'm trying to get a control from metabuilders.com dual list)to work under ASP.NET 2.0. It worked find under 1.1 and then when i migrated my... -
Query help requested
My boss has decided that he wants to mimic Gantt charts in our database, but he's adamant about using the db so people can search. So, I've built... -
[11004] Valid name, no data record of requested type -ASPMAIL
hello, I am getting the following error message Valid name, no data record of requested type when i run the following ASP MAIL script, why?... -
Requested resource in use
Win2K latest service packs IIS 5.0 Connecting to an Access DB *2003)- simple userlogin page, checks userpass & ID I'm all of a sudden getting the... -
why is . converted to _ in $_POST
I have a form that contains some file names (eg this.jpg). When the form posts, and i ready $_POST, I get back this_jpg. What is happening? how... -
byron1021 #2
Re: Value can not be converted to requested type.
Try cfsqltype as cf_sql_varchar and see if that solves the issue. Also try
the return variable as InOut. I think if it's OUT only there may be an issue,
or you could set a default for the value in the proc @intUserid int OUTPUT =
null.
byron1021 Guest



Reply With Quote

