ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 6th, 2007, 04:21 PM
netwearcdz netwearcdz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 1 netwearcdz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 23 sec
Reputation Power: 0
Unhappy ASP 1.0 - I hate this "Application uses a value of the wrong type for the current operation."

Hey all great forums! def a bookmarked page...

I have a problem. which is this

Code:
Error message:Application uses a value of the wrong type for the current operation.


and its on this line:
Code:
 sqlCmd.Parameters.Append(sqlCmd.CreateParameter("@ExpiryDate",    adChar,    adParamInput, 10, Request.Form("qEndDateY")+"."+Request.Form("qEndDateM")+"."+Request.Form("qEndDateD"))); 



Basically my old site would allow you to create a quote... and then would execute the above line plus some other ones to pass as a parameter. I kept everything the same and basically just added a middle page from when you create the quote and when you actually write to the DB.

this page works but fails at this line.

Any ideas?

Reply With Quote
  #2  
Old July 3rd, 2007, 11:23 AM
mswaine mswaine is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 1 mswaine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 9 sec
Reputation Power: 0
This fixed it for me

I was getting the same (unhelpful) error message back from my attempt at executing a stored procedure after trying to add a parameter to the ADO Command Object.

Set cmd = Server.CreateObject ("ADODB.Command")
cmd.ActiveConnection = ADOCon.ConnectionString
cmd.CommandText = "AddToMailQueue"
cmd.CommandType = adCmdStoredProc

--> Crashes out here with
cmd.Parameters.Append cmd.CreateParameter("@EmailBody",adVarChar ,adParamInput ,40000 ,Cstr(EmailBody) )

Set ADORS = cmd.Execute

Turns out that the error was being generated by setting the parameter string size incorrectly.

The fix was to set the string size correctly using the VB Len function.

cmd.Parameters.Append cmd.CreateParameter("@EmailBody",adVarChar ,adParamInput ,Len(EmailBody),Cstr(EmailBody) )

Sorted ...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > ASP 1.0 - I hate this "Application uses a value of the wrong type for the current operation."


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap