Tags: access, base, byte, characters, chineseand, database, double, example, forms, microsoft, mysql, oracle, reports, sql, tryingto

Double Byte Characters

On Database » Microsoft Access

2,903 words with 0 Comments; publish: Fri, 06 Jun 2008 12:44:00 GMT; (25046.88, « »)

I have a Access 2000 Data Base with many forms and reports. I am trying

to use double byte characters in the database. For example the Chinese

and Japanise languages use double byte characters. I am able to store

the characters in the database and produce reports containing those

characters. I do not create recordsets for the reports I build a string and

pass it to the recordsource property of the report.

Part of the application allows the user to archive the

database to a comma seperated text file. When I use the archive sub

routine it creates the archive file and there are no error messages

however it replaces the double byte characters with question marks. If

you look at the code below you will find the code where we are

looping through the dao recordset rstExport, field by field. There are

183 fields in the recordset thus we set up a loop For x = 1 To 183.

We are putting the values of each field it in a variable called mydata.

After we put a field in mydata we add a comma. If the data in each of

the fields is data type dbText we write to the mydata variable one

way. If the field is not dbText we write to the mydata variable another


mydata = rstExport.Fields(0).Value

For x = 1 To 183

If rstExport.Fields(x).Type = dbText Then

mydata = mydata & "," & Chr(34) &

convert2quotes(Nz(rstExport.Fields(x).Value, "")) & Chr(34)


mydata = mydata & "," & rstExport.Fields(x).Value

End If

' Debug.Print rstExport.Fields(x).Name


Open lv_ExportFilename For Append As #filenumber ' Create


Print #filenumber, mydata ' Output text.

Close #filenumber ' Close file.



I ran the program in Debug mode and found that the double byte

characters are not in the DAO recordset. When you do a mose over the

rstExport.Fields(22).Value which is the first field that had the double

byte it says "?". That value is dbText so it goes to the first part

of the if and populates mydata thusly:

mydata = mydata & "," & Chr(34) &

convert2quotes(Nz(rstExport.Fields(x).Value, "")) & Chr(34)

So now I have to figure out why the double byte characters are not in

the DAO recordset. I don't know if it makes any difference but I do not

have a Chinese keyboard or the Chinese version of Windows and in

regional options English is set as the language. I have been copying

and pasting double byte characters into the applications interface using

the character map application.

I have changed the font of the database to Ariel Unicode. Microsoft says

that access supports Unicode but does that mean that VBA supports it. The

recordsource property of a report can deal with it but can a ADO or a DAO

recordset object?

Doug D

United Parcel Service

Billing Analysis Tool Group

Programmer Analyst

All Comments

Leave a comment...