|
-
Dec 10th, 2001, 03:03 AM
#1
Thread Starter
Addicted Member
parameter Error
Deal friends,
when i run my stored procedure from vb it is showing an error "This application has improperly defined a parameter object"
pl. guide me why it is showing
the code is given
Set cmd = New Command
With cmd
.ActiveConnection = con
.CommandType = adCmdStoredProc
.CommandText = "sp_BrandCode"
End With
Dim param As adodb.Parameter
Set param = cmd.CreateParameter("@brandName", adVarChar, adParamInput, Len(cmbBrandName), cmbBrandName)
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@brandCode", adChar, adParamOutput, 0, 0)
cmd.Parameters.Append param
cmd.Execute
MsgBox cmd.Parameters(0).Value
stored procedure
---------------------
CREATE PROCEDURE [sp_BrandCode]
@BrandName varchar(100),
@BrandCode char(4) output
AS
select @brandCode from BrandMaster where brandName = @brandname
thanks
bobbytom
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|