Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
736to740
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
736to740
736to740
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

VBA Oracle UTF8

VBA Oracle UTF8
23.02.2006 11:10:42
Aykut
Hi,
ich habe Probleme Text Dateien, gespeichert in UTF-8 Format,
deren Inhalt z.B. ü, ß, ... enthält ordentlich in der Oracle DB zu speichern.
Die Sonderzeichen werden nicht ordentlich gespeichert.
Wenn ich die Textdateien in ANSI-Format speichere dann klappt es.
Langfristig gesehen werden meine Dateien aber in UTF-8 Format sein,
daher benötige ich die Hilfe.
Derzeit greife ich wie folgt auf die DB zu.
// ----------------------

Function readDBValues() As Boolean
db_url = wsMetaData.Cells(ROW_DB_URL, 2)
db_user = wsMetaData.Cells(ROW_DB_USER, 2)
db_pass = wsMetaData.Cells(ROW_DB_PASSWORD, 2)
Set cnOra = New ADODB.Connection
Set rsOra = New ADODB.Recordset
'Making an ODBC connection according to ADO
conString = "Driver=Oracle in OraHome92; dbq=" + db_url + ";UID=" + db_user + ";PWD=" + db_pass + ";"
cnOra.Open conString
cnOra.Close
readDBValues = True
End Function

// ----------------------
' execute upsert statements

Function executeSQLStatement(sql As String) As Boolean
cnOra.Open conString
rsOra.Open sql, cnOra, adOpenForwardOnly
executeSQLStatement = True
cnOra.Close
End Function

// ----------------------
Was muß ich ändern, damit ich auch UTF-8 Formate in Oracle ordentlich speichern
kann.
Danke, Aykut

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: VBA Oracle UTF8
23.02.2006 22:54:57
EtoPHG
Halo Aykut,
Vielleicht hilft Dir das weiter:
* The OLE/DB driver supports ADO access to UTF8 database starting with release 8.1.6.1.0. You need to use the 8.1.6.1.0 or later driver. If you are using 8.1.6.1.0, you need to set the NLS_LANG character set to UTF8 before starting your applications. If you are using 8.1.7 or later, you do not need to set the NLS_LANG character set to UTF8 unless you use non-ASCII data in your SQL statements. To check if your OLE/DB version is correct, go to the bin directory under your Oracle home and open the property of ORAOLEDB.DLL to see the version.
* There is no UTF8 string in a VB program because all VB strings are Unicode (UCS-2) encoded. That means you cannot pass UTF8 strings to OLE/DB driver through ADO. If you think you have a UTF8 string in VB, you actually have a Unicode (UCS-2) string with each UTF8 byte treated as a Unicode character. You need to make sure the UTF8 data is correctly converted to Unicode encoded VB strings.
Gruss Hansueli
Anzeige

212 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige