Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode and Access

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
I have a Unicode problem. We have a few dataproviders from countries using different characters, eg turkish. When importing access convert these data without the unicode table. So my text got sometimes strange computercharacters.
Should I use another import method to solve this ?
Code:
SysCmd acSysCmdSetStatus, "Step 1: Integrating " & directories.Item(i) & " PE"
                    bestname = basicdir & directories.Item(i) & "\" & filenaam
                    Open bestname For Input As #6
                    While Not EOF(6)
                        Line Input #6, lijn
                        lijn = lijn & vbTab & filename & vbTab & timestp
                        Print #3, lijn
                    Wend
                    telPE = telPE + 1
                    Close #6

I searched something on the internet. If you have a good reference related this subject
 
Have you tried importing the text through the user interface into a table?

If that works, docmd.transfertext is the equivalent way to do it in code.

Although, it does look like you are writing data back out to another file. I'm not sure what you are trying to accomplish there. Although maybe the answer lies in reading and writing binary instead of text (presumably ASCII). It has been a long while but open should have an option to specify text or binary.
 
the last argument of the DoCmd.TransferText is "codepage A Long value indicating the character set of the code page."

1. Is this what the main bij character page ?
2. If so what is the character page for Unicode ?

Code:
DoCmd.TransferText acImportDelim, "PE_temp", "Personal_temp", tempbest_pe, , , 2

 
I couldn't find much on code page... It seems to have to do more with languages and other characters than US character standards. I am guessing there is a Greek equivalent to ASCII and changing the code page to the Greek codepage number allows it to import. So I guess Transfertext reads 8 bit words which means you are sunk for using it to import (unless you want to take the time to get the ASCII of each character, and convert the binary of every 2 characters to unicode).

So it looks like the filesystem object PHV suggested is best. He usually knows idiosynchrasies like "transfertext uses 8 bit words".

MS is now redirecting his posted url to:


With the File System Object though you will have to read in each line programmatically and either insert each record with SQL or use a recordset... I would favor the recordset in this scenario.
 
Some likely Codepage options for Unicode:[ul]
[li]1200: Unicode[/li]
[li]1201: Unicode (Big-Endian)[/li]
[li]65000: Unicode (UTF-7)[/li]
[li]65001: Unicode (UTF-8)[/li][/ul]

CMP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top