Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:24:46+00:00 2026-05-25T19:24:46+00:00

I want to store these characters ‘^+%&/()=?_ via an insert query for an ms

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:24:47+00:00Added an answer on May 25, 2026 at 7:24 pm

    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

    PARAMETERS P_SomeField Text ( 255 );
    INSERT INTO tbl_SomeTable (  P_SomeField )
    VALUES (P_SomeField );
    

    Then you could call like you would any stored procedure

    using(var cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Whatever.mdb")
    {
        var cmd = new OleDbCommand();
        cmd.Connection = cn;
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = cmd.CommandText = "qry_InsSomeTable";
        cmd.Parameters.AddWithValue("P_SomeField", "'^+%&/()=?_ ");
    
        cn.Open();
    
        cmd.ExecuteNonQuery(); 
    
    
    }
    

    Its particularly helpful when you have a table with a bunch of fields

    For example

      cmd.CommandText = @"Insert  Into TableWithAlotofFields 
                        (field1, field2, field3, field4, field5,...)
                        VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?..)";
    
    
      cmd.Parameters.Add("value1");
      cmd.Parameters.Add("value2");
      cmd.Parameters.Add("value3");
      cmd.Parameters.Add("value4");
      cmd.Parameters.Add("value5");
    

    vs.

    Query already define in Access as

     PARAMETERS P_field1Text Text ( 255 ), P_field2 Number, P_field3 text(15), ...;
      Insert Into TableWithAlotofFields 
      (field1, field2, field3, field4, field5,...)
      VALUES(P_field1, P_field2, P_field3, P_field4, P_field5,...)
    

    then in c#

     cmd.CommandText = cmd.CommandText = "qry_InsSomeTable";
     cmd.Parameters.AddWithValue("P_field1", "value1");
     cmd.Parameters.AddWithValue("P_field2", "value2");
     cmd.Parameters.AddWithValue("P_field3", "value3");
     cmd.Parameters.AddWithValue("P_field4", "value4");
     cmd.Parameters.AddWithValue("P_field5", "value5");
    

    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

      cmd.Parameters.AddWithValue("P_field1", "value1");
      cmd.Parameters.AddWithValue("P_field2", "value2");
    

    is not equivalent to

     cmd.Parameters.AddWithValue("P_field2", "value2");
     cmd.Parameters.AddWithValue("P_field1", "value1");
    

    So it seems it mostly stylistic in the differences.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to store a large number of sound files in a database, but
How can store latin characters in appengine? (e.g. peña) when I want to store
I have some html code I want to store in a database. I need
i want to store and retrieve data via the url hash. the user is
I want to store short arrays in a field. (I realize there are reasons
Is there something like SESSION in Windows application? I want to store a few
I just want to ask if there is any PHP/MySQL datatype that can store
There is some html text stored in the Database which I want to show
I want to fill jqGrid from a stored procedure, there was 1 good example
I am a new developer on Android and I want store user data in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.