Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Server replacing characters

 
Rik Sweeney
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever I attempt to retrieve my data from an SQL Server database or a MSAccess database characters like apostrophes ' or double quotes " are changed into other characters such as / and ?. I've checked the database and the data is correct. Has anyone else experienced this problem and does anyone know a solution?
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the data stored in your database? Are they stored as ' and " marks?
 
Rik Sweeney
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dale DeMott:
How is the data stored in your database? Are they stored as ' and " marks?

They're stored as " and '. I have noticed though that if I copy a cell out of access and paste it into, say, notepad I get a formatted ' like Word would do.
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it always the same characters that appear instead of the apostrophe and double quote?
What JDBC driver are you using? JDBC - ODBC bridge?
What happens with Oracle or mySQL?
 
Rik Sweeney
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is always the same characters. I've found out that Microsoft format their single and double quotes like they would in word, instead of the conventional ' or "
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rik,
SQL Server is doing this too? I'm not sure I understand what you mean. Surely the character stored in the database is just the character. When is it being formatted, and what is formatting it? The JDBC driver or the database?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic