Use location marker "?" in the parameter query:<BR>Select * FROM MyTable where Field1=? And Field2=?)<BR><BR>// create a OleDbCommand object<BR>cmd.Parameters.Add("@Field1", OleDbType.Wchar, 10);<BR>cmd.Parameters.Value = "AAA";<BR>// execute the command object
I should have been more specific. I do not want to write the code in line, I wanted to call a stored query in Access. I am familiar with the syntax, I am just trying to find out if you can do it when calling a stored query. Or are you saying that that is the syntax I need in the stored query. I am using [parameter] syntax currently.