Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why I'm getting this error from ASP?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00760164
Message ID:
00760174
Vues:
13
Well, I passed value of Descr1 field instead of ListOfCodes. No vonder, it didn't work. After several hours of trying to fix it in the wrong place, I finally got it... The page is working now...


>Hi everybody,
>
>I'm getting this error:
>Error Type:
>Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
>[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value 'Descript1' to a column of data type int.
>/nadyatest/TestForm.asp, line 56
>
>In my stored procedure I declared tcDescription as text. Right now I've tried varchar (8000) with the same result.
>
>Here is ASP code:
>
>    with cmd
>        .ActiveConnection = dbConn
>        .CommandText = "USP_Insert_ShoppingCartInfo"
>        .CommandType = adCmdStoredProc
>        .CommandTimeout = 7200
>
>        '@tcUserID  varchar(20),
>        '@tnNumOfRecords int,
>        '@tcDescription 	text,
>        '@tcCreditCategory char(1),
>	'@tcSelectionCriteria text,
>        '@tcListOfCodes varchar(8000),
>        '@tnCartID int OUTPUT
>
>        .Parameters.Append .CreateParameter("Return",adInteger,adParamReturnValue)
>
>        .Parameters.Append .CreateParameter("@tcUserID",adVarChar,adParamInput,20,CreditUserID)
>		
>        .Parameters.Append .CreateParameter("@tnNumOfRecords",adInteger,adParamInput,,NumRecs)
>		
>        .Parameters.Append .CreateParameter("@tcDescription",adChar,adParamInput,200,cStr(strDescription))
>		
>        .Parameters.Append .CreateParameter("@tcCreditCategory",adChar,adParamInput,1,CreditCategory)
>		
>        .Parameters.Append .CreateParameter("@tcSelectionCriteria",adVarChar,adParamInput,8000,SelectionCriteria)
>		
>        .Parameters.Append .CreateParameter("@tcListOfCodes",adVarChar,adParamInput,8000,ListOfCodes)
>		
>' 7th parameter is Output parameter
>        .Parameters.Append .CreateParameter("@tnCartId",adBigInt,adParamOutput, ,CartId)
>        .Execute recs, , adExecuteNoRecords
>        retval = .Parameters(0)
>        CartID = .Parameters(7)
>    end with
>
>    CloseCmd(cmd)
>    CloseDBConn(dbConn)
>end function
>
>I've tried several modifications with this line:
> .Parameters.Append .CreateParameter("@tcDescription",adChar,adParamInput,200,cStr(strDescription))
>
>trying to make it work, but it gives me this error for anything, I've tried. Do you see, what could be wrong?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform