Обсуждение: Unicode display in VB
Dear all,
I am still trying to figure out how to display Japanese text in pgAdmin2.
Microsoft Form Two objects and MS Hierarchical Flexgrid Control 6.0 both
support Unicode display.
To verify, just create this form:
Private Sub Command1_Click()
' create a Unicode text file with Chinese character
' Dan1 and English character D.
Dim a(0 To 5) As Byte
a(0) = &HFF ' All Unicode string begin with &HFF and &HFE
a(1) = &HFE
a(2) = &H39 ' Dan1
a(3) = &H4E
a(4) = &H44
a(5) = &H0
Open "unicode.txt" For Binary As #1
Put #1, , a
Close #1
Dim txtline As String
' you may need to change the path of the file
Open "unicode.txt" For Binary As #1
txtline = InputB(2, #1) ' always FF FE, skip them
txtline = InputB(4, #1)
Close #1
TextBox1.Text = txtline ' display the string
'MSHFlexGrid1.Text = txtline
End Sub
This will display one Chinese Glyph and the lettre 'D', provided that Arial
Unicode font is installed.
I tried to link MSHFlexGrid1 to a data source, but I did not see any
Japanese character.
Did anyone succeed in displaying Japanese character in MSHFlexGrid?
Best regards,
Jean-Michel POURE
> -----Original Message----- > From: Jean-Michel POURE > > Dear all, > > I am still trying to figure out how to display Japanese text in pgAdmin2. > > Microsoft Form Two objects and MS Hierarchical Flexgrid Control 6.0 both > support Unicode display. IIRC Unicode fundamentally means UCS-2 not UTF-8 under Windows whereas in PostgreSQL UNICODE means UTF-8 not UCS-2. Currently psqlodbc driver doesn't provide the functionality for UCS-2 clients to talk to PostgreSQL servers. We have to implement pretty many SQLxxxxxW API functions and handle SQL_C_WCHAR type bindings in psqlodbc drvier to provide the functionality. If you are in the Japanese environment, you could talk to UTF-8 servers by setting Connect string as SET CLIENT_ENCODING to 'SJIS' and display Japanese characters but it doesn't seem your case. regards, Hiroshi Inoue
Hi, I have this simple code that uses ADO to insert a row in a test table
with a serial id and a varchar,
after insert I can obtain varchar's value but I *can't* obtain id's value of
this record. What I'm doing wrong ??
Thanks!
*Table definition:
mydatabase-# \d societats;
idsocietat | integer | not null default
nextval('"societats_idsocietat_seq"'::text)
nomsocietat | character varying(50) |
capitalsocial | double precision | default 0
*Postgres 7.1.3 under FreeBSD 4.4
*VB code
Private Sub Command3_Click()
' Dims omited
Set Cnxn = New ADODB.Connection
strCnxn = "Provider=MSDASQL.1;Persist Security Info=False;Data
Source=mysource"
Cnxn.Open strCnxn
Set rstEmployees = New ADODB.Recordset
strSQL = "societats"
rstEmployees.Open strSQL, strCnxn, adOpenKeyset, adLockOptimistic,
adCmdTable
strFirstName = Trim(InputBox("Put name:"))
rstEmployees.AddNew
rstEmployees!nomsocietat = strFirstName
rstEmployees.Update
' Show the newly added data
MsgBox "New record: " & rstEmployees!idsocietat & " " &
rstEmployees!nomsocietat
'''''rstEmployees!idsocietat returns nothing !!!!!!!!!!!!!!
rstEmployees.Close
Cnxn.Close
Set rstEmployees = Nothing
Set Cnxn = Nothing
End Sub