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 1082355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:17:09+00:00 2026-05-16T22:17:09+00:00

Problem with % n * %n in writable segment detected * C++ i Qt

  • 0

Problem with % n * %n in writable segment detected * C++ i Qt

I have program that process big data, that can’t be modified. In one file we encounter “100% na” and application stop.

When I checked it with debuger, it return * %n in writable segment detected *.

I can’t change visible that data, user must see “100% na”. I thought of inserting some whitespace other then space after %.

Rewriting the whole applications is not a point. It runs on Windows and Linuks.

Currently the problem is in this code. I checked this in other places and it was the same. The variables are QStrings.

QSqlQuery query;

query.exec("insert into table_name ("+variable_with_columns_names+" values ("+variable_with_data_to_insert+");");

Do you have any ideas how to evade it?

edit

Prepare the query solved the problem in this spot. But it is breaking in others points. Update , Select … where …=’100% na'(as variable), generating reports and other stuff. Whats more that this data is used by at least 5 modules, each using more then 5 data tables. So I will wait sometime, if anyone have other solution.

PS. One more question:
Why is “% n” interpreted as “%n”, when it shouldn’t?

Funny thing is if I change “100% na” to “100%% na”, I get in data base “100%% na” when it should be changed to “100% na”.

  • 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-16T22:17:10+00:00Added an answer on May 16, 2026 at 10:17 pm

    Use prepare to prepare the query. Then insert the values using bindValue. Prepared statements should always be used in such scenarios, as they handle the escaping of special characters for you.

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

Sidebar

Related Questions

Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Problem I have timestamped data, which I need to search based on the timestamp
Problem: We have a web app that calls some web services asynchronously (from the
I'm deploying an application using ClickOnce, the problem is that the configuration file (xxx.exe.config)
I have a small server program that accepts connections on a TCP or local
Problem: We have to read from a proprietary binary file at work. It changes
Problem: I have an address field from an Access database which has been converted
Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes
Problem solved: Thanks guys, see my answer below. I have a website running 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.