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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chinese characters from text file - HOW!!!

Status
Not open for further replies.

ghayman73

Technical User
Jul 3, 2002
55
0
0
FR
i have a text file with chinese characters and english characters that i need to insert into a row of a table.
I need to get the whole text file so i can do some text manipulation later.

However when i try and open the file using VB
Code:
Dim FSO As New FileSystemObject
Dim colFiles As Files
Dim objFolder As folder
Dim objFile As TextStream
Dim strPath As String
Dim strHTML As String


strPath = "C:\somepath\"
mstrFolderName = strPath
Set objFolder = FSO.GetFolder(strPath)
Set colFiles = objFolder.Files

For Each File In colFiles
    
    Set objFile = FSO.OpenTextFile(File, ForReading, False, TristateMixed)
    
    Dim objcon As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim strSql As String
    
    Set objcon = CurrentProject.Connection
    strSql = "__TABLENAME"
    rs.Open strSql, objcon, adOpenDynamic, adLockOptimistic
    strHTML = objFile.ReadLine
    rs.AddNew
    rs!HTMLtext = strHTML
    rs.Update
    rs.Close
    

Next


I dont get the chinese Characters they are some other character set.

if i use notepad to view the File all looks well my local has chinese available to it.

Any tips would be appreciated please or is this just not possible using this method.

If anyone knows of another method please let me know.

Grant
 
Try to replace TristateMixed with TristateUseDefault or TristateTrue.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

Thanks for the suggestion but ive tried all states and never get the right result back.

Thanks

Grant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top