Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Application uses Value of wrong type for the curre

Author  Topic 

sasan_vm
Yak Posting Veteran

51 Posts

Posted - 2011-07-20 : 03:08:33
Hello,
I have procedure with this parameters:


CREATE PROCEDURE sp_TableData
@table sysname ,
@row sysname ,
@num bigint ,
@cond bit ,
@start bigint=null ,
@end bigint=null ,
@clause nvarchar(3000)=null
AS

In client application using ADO for calling this procedure:


// param types
ADOMaster->Parameters->ParamByName("@table")->Value = FTableName; // AnsiString
ADOMaster->Parameters->ParamByName("@row")->Value = "ID"; // AnsiString
ADOMaster->Parameters->ParamByName("@num")->Value = dbPaging->Result; // int
ADOMaster->Parameters->ParamByName("@cond")->Value = true; // boolean
ADOMaster->Parameters->ParamByName("@start")->Value = v_nul; // __int64
ADOMaster->Parameters->ParamByName("@end")->Value = v_nul; // __int64
ADOMaster->Parameters->ParamByName("@clause")->Value = Text; // AnsiString
ADOMaster->Requery();




Parameters create at design time and all type and size is true, but many time got this error:
"Application uses Value of wrong type for the current operation"

Regards,
sasan.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-07-20 : 03:27:28
The parameter that come in my mind is the @cond parameter.
Many programming languages use -1 and 0 for TRUE/FALSE.
SQL Server uses 1 and 0.


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -