Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message when executing Stored procedure - ADODB.Command error 1

Status
Not open for further replies.

hpadwal

Programmer
Feb 6, 2006
57
GB
Hello all,

I am getting the following error:

Code:
ADODB.Command error '800a0d5d' 

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

D:\WEBSITES\PROD03\COMMISSIONER\../_inc/_submission.asp, line 93

it is pointing to:

.parameters("@FromAssistantID") = iAssistantID

Here is the full code:

Code:
sub MoveSubmissions (iAssistantID, iFromCommieID, iTargetCommieID, sSubmissionIDs, iNotes)

	if (isnumeric(iAssistantID) or isnumeric(iFromCommieID)) and isnumeric(iTargetCommieID) and len(sSubmissionIDs)>0 then
		dim oCon : set oCon = server.CreateObject("adodb.connection") : oCon.open con
		dim oCmd : set oCmd = server.CreateObject("adodb.command")
				
		with oCmd
			.activeconnection = oCon
			.commandtext = "moveSubmission"
			.commandtype = &h0004
			[b].parameters("@FromAssistantID") = iAssistantID[/b]
			.parameters("@ToCommissionerID") = iTargetCommieID
			.parameters("@FromCommissionerID") = iFromCommieID
			.parameters("@SubmissionIDs") = sSubmissionIDs
			.parameters("@autoNotes") = iNotes
			.execute
		end with
		
		set oCon = nothing
		set oCmd = nothing
		
		LogError "MoveSubmission", "SUCCEEDED: iAssistantID: " & iAssistantID & ", iFromCommieID: " & iFromCommieID & ", iTargetCommieID: " & iTargetCommieID & ", sSubmissionIDs: " & sSubmissionIDs & ", iNotes: " & iNotes
	else
		LogError "MoveSubmission", "FAILED: iAssistantID: " & iAssistantID & ", iFromCommieID: " & iFromCommieID & ", iTargetCommieID: " & iTargetCommieID & ", sSubmissionIDs: " & sSubmissionIDs & ", iNotes: " & iNotes
	end if	
end sub

Can you help?

If you need any more info please ask :)

thanks

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

To be successful inlife, you must thing your less then the person next to you.

 
This is just a guess:[tt]
if isnumeric(iAssistantID) then
.parameters("@FromAssistantID") = iAssistantID
else
.parameters("@FromAssistantID") = null
end if
[/tt]

I'm not sure if you actually want to send a null in the case that iAssistantID is not numeric... would have to see the parameter declaration in the stored procedure... might just leave it off altogether:[tt]
if isnumeric(iAssistantID) then
.parameters("@FromAssistantID") = iAssistantID
end if
[/tt]
 
No, it must submit the value and not be null.

Sheco - thanks for spotting those mistake, i dont understand it too

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

To be successful in life, you must think your less then the person next to you?!?!?!?!

 
your less then

or

you're less than


I still don't get it.

 
Back to the matter at hand... If iAssistantID must be non-null then you should either change this:[tt]
if (isnumeric(iAssistantID) or isnumeric(iFromCommieID)) and isnumeric(iTargetCommieID) and len(sSubmissionIDs)>0 then[/tt]

to this:[tt]
if isnumeric(iAssistantID) [red]and[/red] isnumeric(iFromCommieID) and isnumeric(iTargetCommieID) and len(sSubmissionIDs)>0 then[/tt]


Or alternatively send a zero when the value is non-numeric:[tt]if isnumeric(iAssistantID) then
.parameters("@FromAssistantID") = iAssistantID
else
.parameters("@FromAssistantID") = 0
end if[/tt]

 
Brilliant thats it! still have a few bugs so il keep you guys posted. hopefully wont have to.

i used

if isnumeric(iAssistantID) and isnumeric(iFromCommieID) and isnumeric(iTargetCommieID) and len(sSubmissionIDs)>0 then

Excellent

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

To be successful in life, you must think your less then the person next to you?!?!?!?!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top