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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with error passing parameter!!

Status
Not open for further replies.

MDA

Technical User
Jan 16, 2001
243
US
Hi all,

I have a small app that executes a stored procedure. I am getting an error only on certain databases and I cannot understand why! It seems to only show on SQL Server 7.0, have not seen it on SQL 2000 yet....

the error is:
..error 3421 method 'value' of object '_parameter' failed

I can't understand why the error is NOT consistant amongst all the databases I run the app on.

my VB parameters are:
---------------------
Set cmd.ActiveConnection = Cn
' Define the stored procedure.
cmd.CommandText = "sp_data_trans"
cmd.CommandType = adCmdStoredProc

' Set values to parameters, and execute the query.
cmd.Parameters("@NewTT") = frmMain.combotooTT.Text
cmd.Parameters("@OldTT") = frmMain.combofromTT.Text
cmd.Parameters("@StartPE") = frmMain.PEstart.Text
cmd.Parameters("@EndPE") = frmMain.PEend.Text
cmd.Parameters("@Journum") = frmMain.txtJour.Text
cmd.Parameters("@JourDesc") = frmMain.txtJourDesc.Text
cmd.Parameters("@NewTC") = frmMain.cmboJourTC.Text

Cn.CommandTimeout = 0
Set rs = cmd.Execute
---------------------------
In the Stored procedure I have:
....
@NewTT varchar(4), @OldTT varchar(4), @StartPE varchar(5), @EndPE varchar(5), @Journum integer, @jourDesc varchar(255), @NewTC varchar(4)
....
--------------------------

Any ideas why I amgetting this error??? I have read up on MSDN but could not find anything to solve this challenge.

Any help is greatly appreciated!!!

Best regards,

Mike
 
opps.. I figured it out... so easy yet-- took me an hour to realize. I was passing 5 letters to a variable that was only set to receive 2.

Problem solved..

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top