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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:53:32+00:00 2026-05-15T14:53:32+00:00

I have some data stored in SQL Server that contains apostrophes. Within the SQL

  • 0

I have some data stored in SQL Server that contains apostrophes. Within the SQL Server table to apostrophe is escaped. For example the phrase “Roberts’s thesis” is stored as “Robert”s Thesis”. I use Access 2003 as a font end for the application and I use ADO to access the data stored in SQL Server using Stored Procedures.

The issue I am having is how to “un-escape” the double apostrophe when the data is retrieved using a recordset and then bound to a control. Here is some sample code.

  Dim cnn As ADODB.Connection
  Dim rs As ADODB.Recordset


  Set cnn = New ADODB.Connection
  cnn.ConnectionString = myConnectionString
  cnn.Open

  Set rs = New ADODB.Recordset
  Set rs.ActiveConnection = cnn
  rs.Source = "EXEC uspMyStoredProcedureName"

  rs.LockType = adLockOptimistic
  rs.CursorType = adOpenStatic
  rs.CursorLocation = adUseClient
  rs.Open

  Set ListControl.Recordset = rs

  Set rs = Nothing
  Set cnn = Nothing

Do I have to “loop” through the recordset manually and un-escape the apostrophe? Thank you.

  • 1 1 Answer
  • 1 View
  • 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-15T14:53:32+00:00Added an answer on May 15, 2026 at 2:53 pm

    You don’t have to unescape anything. The doubled-apostrophe form is only used for string literals inside SQL statements. The actual value inserted in the database by INSERT... 'Robert''s Thesis'; is Robert's Thesis, and that is the value you’ll get out when you read it from a recordset grabbed from a SELECT.

    If whatever’s inside uspMyStoredProcedureName is doing something weird to cause doubled apostrophes to get returned then it’s broken and needs fixing; if you have Robert''s Thesis as an actual value in the database, then you’ve inserted broken data and you should be looking at fixing the code that’s done that, and cleaning up the data.

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

Sidebar

Related Questions

I have a SQL Server table that contains some datetime data. I'm using a
I have a stored procedure in SQL Server that returns some data via a
I have a table in SQL Server 2005 which contains some changelog data for
I have some varbinary data stored in a table in MS Sql Server 2005.
In SQL Server, I have a table where a column A stores some data.
I have some XML data stored in a varchar(max) column on SQL Server 2005.
I have some (untyped) XML being stored in SQL Server 2005 that I need
I have some data that is stored in a TIMESTAMP(6) WITH TIMEZONE column in
I have a stored procedure that logs some data, how can I call this
I have a table from a vendor application that stores some xml data into

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.