Using a stored procedure in an SQL Database with VB calling it:
CREATE procedure dbo.up_select_company
@code_id varchar(4)
as
select *
from company
where code = @code_id
VB part:
cmdcompany.Parameters.Append cmdcompany.CreateParameter("@code_id", adVarChar, adParamInput, 4, varcode)
Problem I keep getting a run time error ( application uses a value of the wrong type for the current operation) run-time error 3421, when varcode has both letters and numbers example "E234" What do the data types need to be?
varcode is decleared as string because it can either be all numbers all letters or a mixure of both.
CREATE procedure dbo.up_select_company
@code_id varchar(4)
as
select *
from company
where code = @code_id
VB part:
cmdcompany.Parameters.Append cmdcompany.CreateParameter("@code_id", adVarChar, adParamInput, 4, varcode)
Problem I keep getting a run time error ( application uses a value of the wrong type for the current operation) run-time error 3421, when varcode has both letters and numbers example "E234" What do the data types need to be?
varcode is decleared as string because it can either be all numbers all letters or a mixure of both.