# Stored Procedure, Parameter Passing

**URL:** <https://www.dynamicsuser.net/t/stored-procedure-parameter-passing/10087>\
**Category:** Developers Forum\
**Created:** [June 30, 2005, 9:18am UTC](https://www.dynamicsuser.net/t/stored-procedure-parameter-passing/10087 "2005-06-30T09:18:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [June 30, 2005, 9:18am UTC](https://www.dynamicsuser.net/t/stored-procedure-parameter-passing/10087/1 "2005-06-30T09:18:44Z")

</div>

Hello all, I try to call a Stored Procedure within the SQLServer DB and I found an example how to call it by using the MSSQLDMO Object Library. Unfortunetally this example doesn´t show how to hand over parameters to the Stored Procedure. Can anybody provide me with some hints? Thanks.

---

<div class="post-metadata">

**Author:** ![stryk](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@stryk](https://www.dynamicsuser.net/u/stryk)\
**Post date:** [July 1, 2005, 7:56am UTC](https://www.dynamicsuser.net/t/stored-procedure-parameter-passing/10087/2 "2005-07-01T07:56:21Z")

</div>

Well, we use MSADO to connect a SQL Server and to execute any kind of SQL statements, thus also stored procedures. **ADOConnection, Type: Automation, Subtype: ‘Microsoft ActiveX Data Objects 2.7 Library’.Connection** Within the code we build the SQL statements as a text string; e.g. **Statement := STRSUBSTNO(‘exec sp\_who %1’, ProcessID);** The we “fire” this with`RecordsAffected := 0; // Command Option Values: // adCmdFile : 256 = Evaluate as a previously persisted file // adCmdStoredProc : 4 = Evaluate as a stored procedure // adCmdTable : 2 = Have the provider generate a SQL query and return all rows from the specified table // adCmdTableDirect : 512 = Return all rows from the specified table // adCmdText : 1 = Evaluate as a textual definition // adCmdUnknown : 8 = The type of the CommandText parameter is unknown // adCmdUnspecified : -1 = Default, does not specify how to evaluate Options := 1; ADOConnection.Execute(Statement,RecordsAffected,Options);`
