I want to store these characters ” ‘^+%&/()=?_ ” via an insert query for an ms access database. How do I do this and prevent from every cases?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In addition to using a parameterized query (see Adrian’s Answer) you can use a Query Definition with a parameter and call it.
For example you could create a query named qry_InsSomeTable with the following sql
Then you could call like you would any stored procedure
Its particularly helpful when you have a table with a bunch of fields
For example
vs.
Query already define in Access as
then in c#
However as @David-W-Fenton points out the names on the parameters are ignored and only the position is taken into account.
e.g.
This
is not equivalent to
So it seems it mostly stylistic in the differences.