Solved How to insert special characters in a field? (1 Viewer)

KitaYama

Well-known member
Local time
Tomorrow, 00:03
Joined
Jan 6, 2022
Messages
1,541
BE : Sql Server ---- FE : Access

I have a remark field in a table that needs to be filled with some special characters. I type the character in the textbox of a single form, move to the next record and then move back to the same record. The special character is just fine. but as soon as I requery the form, the special character changes to something else.

Example:
I need to enter 107 cubic meter. I type 107 then m and then ALT+0179 --> the textbox in the form shows it as 107m³
Requering the form changes it to 107m3
ø changes to o

I've tested it on varchar and text data types.
Both shows the same result.

How can I keep the inserted special characters?
Any kind of advice is much appreciated.
 
Last edited:

KitaYama

Well-known member
Local time
Tomorrow, 00:03
Joined
Jan 6, 2022
Messages
1,541
Did some experiments on a test table. Seems that if I use nvarchar data type, the problem is solved.

If I change the datatype of the field from varchar to nvarchar, will I loose the current saved data in this field?
The table has more than a million and half records.

thank you.
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 16:03
Joined
Feb 19, 2013
Messages
16,618
Shouldn’t do but recommend take a copy of the table first, or at least try it on a test table.

or create a new field, and update to that. Once happy , delete the old field and rename the new
 
Last edited:

KitaYama

Well-known member
Local time
Tomorrow, 00:03
Joined
Jan 6, 2022
Messages
1,541
Shouldn’t do but recommend take a copy of the table first, or at least try it on a test table.

or create a new field, and update to that. Once happy , delete the old field and rename the new
I'll go with your last suggestion. (adding a new field and update it) It seems to be safest and the fastest.

Thank you.
 

Cotswold

Active member
Local time
Today, 16:03
Joined
Dec 31, 2020
Messages
528
As well as Chr(0179) you can also use Chr(252) which always did as I expected it to. ³
 

Users who are viewing this thread

Top Bottom