Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: ADO Parameter object Error


Message #1 by "Mohideen" <mohideen@a...> on Thu, 30 Aug 2001 16:23:26 +0530
Hi

do you need to specify the data length and the data value in the 
before appending?

Set empPrm = Empcmd.CreateParameter("Ecode", adChar, adParamInput,30,
txtEmpCode)

Nigel

> -----Original Message-----
> From:	Mohideen [SMTP:mohideen@a...]
> Sent:	Thursday, August 30, 2001 11:53 AM
> To:	professional vb
> Subject:	[pro_vb] ADO Parameter object Error
> 
>      
> Hi techies,
> 
> In the following code, I am trying to send the value as parameter to a
> stored procedure (sql 7.0). While doing that I am getting this error 
>  " Parameter object is improperly defined. Inconsistant or incomplete
> information prodived "
> Can anybody tell me, what is the error in my code.
> 
> 
> Dim empconn As new ADODb.connection
> Dim empcmd As new ADODb.command
> Dim emprs As new ADODb.recordset
> Dim empPrm As ADODb.Parameter
> 
> Empconn.ConnectionString = "Provider=SQLOLEDB;Data Source 
> alacntm;Initial Catalog = 
>                     Training;      User ID= sa; Password =;"
> Empconn.Open
> Empconn.CursorLocation = adUseClient
> 
> Empcmd.CommandType = adCmdStoredProc
> Empcmd.CommandText = "usp_pEmployee"
> Set empPrm = Empcmd.CreateParameter("Ecode", adChar, adParamInput)
> Empcmd.Parameters.Append empPrm
> Empcmd.ActiveConnection = Empconn
> empPrm.Value = txtempcode
> Set Emprs = Empcmd.Execute
> 
> Thanks
>       
>       
> 
> 
> nigel.parker@c...

  Return to Index