Run Time Error'-2147217839(80040e51)':The provider cannot derive parameter info and SetParameterInfo has not been called.
Posted on 2003-11-08
I am developping a datbase application in VB.I am using stored procedure for accesiing some data from database.The database is in MS Access
& using a DSN.
Iam using command & recordset object of adodc.I have an Item_Master table from where I want some details through stored procedure.The stored proc name is "Get_Max_Item_Code" & it has 3 parameters named SOBID,CATCODE,SUBCATCODE .When I set value for these parameters in a sub a got the above mentioned error message.This stored proc was called after another stored procedure which has only one parameter & it was executed without any peroblem.The code segment inwhich problem arrived is:
Public Sub Gen_New_Item_Code()
Dim Rs As New ADODB.Recordset
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "Get_New_Item_Code" 'STORED PROCEDURE NAME
Cmd.Parameters("SOBID") = (Txt_Item(0).Text) 'SOB ID (here is the problem)
Cmd.Parameters("CATCODE") = Cmb_Item(3).Text 'CATEGORY CODE
Cmd.Parameters("SUBCATCODE") = Cmb_Item(4).Text 'SUB CATEGORY CODE
Set Rs = Cmd.Execute()
I don't know what to do with this problem.If any one has answer to it ,pls send as soon as possible.