EziData Solutions

Web, NET and SQL Server

Adding Parameters to Access Queries

Option 1:

Create a Parameter object and add this to an existing Command object.

'Create a new parameter

Dim myParam As New OleDbParameter("ParamName", paramValue)

'add the parameter to the command

cmd.Parameters.Add(myParam)

Option 2:

Use the AddWithValue option to add a Parameter directly to the Command object.

'create, assign value and add a new parameter to the command

cmd.Parameters.AddWithValue("ParamName", paramValue)

 

Posted: Oct 06 2009, 21:31 by Admin | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Access