Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sql server stored procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-09 : 09:48:47
baladitya writes "how to return the out put of a sql server stored procedure?
how to pass the parameters from front_end(vb6),i am trying with ado command object
if possible please send the code

thanq"

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-05-09 : 10:18:39
Calls a stored procedure called up_CanIConnect.
with two input parameters and one output parameter returned.

Set cmUsers.ActiveConnection = cnSource
cmUsers.CommandType = adCmdStoredProc
cmUsers.CommandText = "up_CanIConnect"
cmUsers.Parameters.Append cmUsers.CreateParameter("LicenceMode", adInteger, adParamInput, , intLicenceMode)
cmUsers.Parameters.Append cmUsers.CreateParameter("Users", adInteger, adParamInput, , intUsers)
cmUsers.Parameters.Append cmUsers.CreateParameter("Allow", adTinyInt, adParamOutput)
cmUsers.Execute
intAllow = cmUsers.Parameters("Allow").Value
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2002-05-09 : 10:23:07

Here's the basic procedure:

1. Create an ADO connection
2. Create an ADO command for this connection.
3. For each of the parameters in the stored procedure (both input and output) create an ADO parameter. Append each parameter to the command.
4. Execute the command
5. Recurse through the command's parameters, reading out the new values.

You can check out microsoft.com for more information

Tim

Go to Top of Page
   

- Advertisement -