Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2006, 11:56 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default CreateParameter - wrong type

Hi All

I am having a little CreateParameter problem...

What I am trying to do is create a parameter for a stored procedure using ADODB.Command's CreateParameter object (as detailed within ASP 3 book). The format I am using is:

Code:
Set objParam = objComm.CreateParameter("@paramName", adChar, adParamInput, 30)

objComm.Parameters.Append objParam1

Dim intValue

intValue = 1 or 2 or 3 or 4 or 5

objComm.Parameters("@paramName") = intValue
As you can see from the above, I am trying to add within this 1 parameter, a value that includes a series of numbers using an OR operator.

I have tried various ways and the closest I get is receiving the following error:

Application uses a value of the wrong type for the current operation.

Does anyone have any wisdom they are willing to share with me?

Warm Regards

Rit
__________________
Rit
www.designandonline.co.uk
INSPIRE | CREATE | DELIVER
 
Old January 9th, 2006, 01:11 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Rit,

Does it help to convert intValue to a string first using CStr(intValue) ??

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 2nd, 2006, 08:39 PM
Authorized User
 
Join Date: Dec 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to lameneural
Default

Also happened to me, however, in your case, it is a datatype issue. Mine was of the same type - char/varchar. What I did was, I checked if Sizes of the fields in the table and the parameter I was trying to insert. The value I was inserting was longer than the size limit of the field. So I modified the limit just to fit the parameter.

Nothin.. Just sharing..






Similar Threads
Thread Thread Starter Forum Replies Last Post
Guidelines Item 3: Replace System.Type with Type Ixtlia BOOK: Professional .NET 2.0 Generics 0 August 19th, 2007 04:09 AM
Arguments are of the wrong type, are out of accep jenpitts ASP.NET 2.0 Basics 3 August 14th, 2007 03:00 PM
Arguments are of the wrong type???? Seb_soum Classic ASP Databases 12 November 9th, 2006 02:20 PM
Query on the wrong data type ggiibboo VB Databases Basics 1 January 31st, 2006 07:44 PM
Odd problem with ADO CreateParameter Imar Pro VB Databases 7 January 13th, 2005 09:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.