Re: Passing Parameter Values in code with Adodc Control
From: Val Mazur (group51a_at_hotmail.com)
Date: 03/18/04
- Next message: Val Mazur: "Re: Recordset Update when multiple tables provide the data"
- Previous message: A: "Exception Error"
- In reply to: Michael Edwards: "Passing Parameter Values in code with Adodc Control"
- Next in thread: Michael Edwards: "Re: Passing Parameter Values in code with Adodc Control"
- Reply: Michael Edwards: "Re: Passing Parameter Values in code with Adodc Control"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 17 Mar 2004 21:12:07 -0500
Hi Michael,
I am not using bound controls at all (and do not suggest to use bound
controls to other developers), but I think your code should look something
like
Dim loCommand As ADODB.Command
Dim loParameter As ADODB.Parameter
Set loCommand = New ADODB.Command
loCommand .CommandText="sp_name here"
loCommand.CommandType=adCmdStoredProc
Set loParameter = loCommand.CreateParameter("@company_name", adVarChar, 50)
loParameter.Value = "MyValueHere"
loCommand.Parameters.Append loParameter
Set Adodc1.RecordSource = loCommand
-- Val Mazur Microsoft MVP "Michael Edwards" <mjenco@hotmail.com> wrote in message news:u5%23snn5CEHA.240@tk2msftngp13.phx.gbl... > Is it possible to pass a parameter value to a stored procedure via VB code > to an ADO Data Control in VB6? > > For example, I have a stored procedure with a varchar(50) parameter > @company_name. Is there a way to pass a value in code from a string > variable > strCompanyName to the stored procedure attached to the ADO Data Control? > > -- > Sincerely, > muDDfish Mike > http://www.kingmuddfish.com > >
- Next message: Val Mazur: "Re: Recordset Update when multiple tables provide the data"
- Previous message: A: "Exception Error"
- In reply to: Michael Edwards: "Passing Parameter Values in code with Adodc Control"
- Next in thread: Michael Edwards: "Re: Passing Parameter Values in code with Adodc Control"
- Reply: Michael Edwards: "Re: Passing Parameter Values in code with Adodc Control"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|