Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim rs As ADODB.Recordset
- Set rs = New ADODB.Recordset
- Dim cmd As New ADODB.Command
- customerName = .Range("customerName")
- queryCustomers = "select * from Customers where CustomerName = '" & customerName & "'"
- 'Open a connection to SQL Server
- conn.Open cnstring
- With cmd
- .CommandText = queryCustomers
- .Parameters.Append .CreateParameter("@param1", adVarChar, adParamInput, 50, customerName)
- .ActiveConnection = conn
- .CommandType = adCmdText
- End With
- Set rs = cmd.Execute
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement