Insert unicode char into Oracle 9 using ADO
Hi.
I have an Excel sheet which is used to maintain the content of Oracle tables.
One of the columns contain unicode text.
If I enter unicode text in a cell it gets uploaded as '?'.
I use a dsn with the ODBC driver supplied with Oracle client 9.x.x.x
Code snippet... NB I tried to reduce the code as much as possible.
Code:
' Create connection
Public conn As ADODB.Connection
Set conn = New ADODB.Connection
' Open connection to database
conn.Open "Password=" & sPassword & ";User ID=" & sUsername & ";Data
Source=" & sDatabase & ";Persist;Security Info=True"
'Create SQL statement and execute it.
sSQLStr = "INSERT INTO USERID.MAGNUS_TEST (C1,C2) VALUES (" & sData & ")"
conn.Execute sSQLStr
'Set value to another cell just to make sure that SQL string really
contains unicode characters
Sheets("Data").Cells(1, 5).Value = sData
' Close connection
conn.Close
Set conn = Nothing
I know that sData contains unicode data since the Cell(1,5) displays correctly after update. Unfortunatly the result is that a text containing '?' instead of unicode characters is stored in the database.
Any hints on where to start digging is appreciated.
/Magnus
Expand AllCollapse All:confused: :confused: