Create Proc [dbo].[PassP]
|
@Id smallint
|
as
|
Select * from dbo.Customers where Id=@Id
|
|
|
Visual Basic
|
|
|
Dim sqlcnn As New ADODB.Connection
|
Dim cmd As ADODB.Command
|
|
sqlcnn.ConnectionString = “Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Test;Data Source=server”
|
sqlcnn.Open
|
sqlcnn.CommandTimeout = 120
|
|
|
Set cmd = New ADODB.Command
|
cmd.ActiveConnection = sqlcnn
|
cmd.CommandType = adCmdStoredProc
|
cmd.CommandText = “dbo.PassP”
|
|
cmd.Parameters.Append cmd.CreateParameter(“custId”, adInteger, adParamInput, 6, Combo1.ItemData(Combo1.ListIndex))
|
cmd.Execute
|
|
Set cmd.ActiveConnection = Nothing
|