Pass Parameters to SQL Stored procedure from VB Application Archives - Tech Insights https://reactconf.org/category/pass-parameters-to-sql-stored-procedure-from-vb-application/ Unveiling Tomorrow's Tech Today, Where Innovation Meets Insight Sat, 05 Jan 2013 06:56:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/reactconf.org/wp-content/uploads/2023/11/cropped-reactconf.png?fit=32%2C32&ssl=1 Pass Parameters to SQL Stored procedure from VB Application Archives - Tech Insights https://reactconf.org/category/pass-parameters-to-sql-stored-procedure-from-vb-application/ 32 32 230003556 Passing Parameters https://reactconf.org/passing-parameters/ https://reactconf.org/passing-parameters/#respond Sat, 05 Jan 2013 06:56:00 +0000 http://www.sqlneed.com/2013/01/05/passing-parameters/ Pass Parameter to SQL Stored procedure from VB Create Stored Procedure in SQL Server Create Proc [dbo].[PassP] @Id smallint as Select * from dbo.Customers where Id=@Id Visual Basic Dim sqlcnn …

The post Passing Parameters appeared first on Tech Insights.

]]>

Pass Parameter to SQL Stored procedure from VB
Create Stored Procedure in SQL Server
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

The post Passing Parameters appeared first on Tech Insights.

]]>
https://reactconf.org/passing-parameters/feed/ 0 2232