Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2001
    Location
    Finland, Kirkkonummi
    Posts
    17

    Unanswered: Problem when inserting data into UTF8 database using VB and ADO

    Hello
    I am unable to insert data into table which has NVARCHAR2 column using Visual Basic and ADO.
    What happens is that I get a [Oracle][Ora]ORA-12704 character set mismatch error.

    Database information:
    NLS_RDBMS_VERSION 8.1.7.0.0
    NLS_CHARACTERSET UTF8
    NLS_NCHAR_CHARACTERSET UTF8

    NLS_LANGUAGE FINNISH
    NLS_TERRITORY FINLAND

    I have tried both client NLS_LANG settings:
    FINNISH_FINLAND.UTF8
    FINNISH_FINLAND.WE8ISO8859P1
    (The first database installation used WE8ISO8859P1 as CHARACTERSET and NCHAR_CHARACTERSET.)

    Oracle ODBC driver version is 8.01.75.00.

    I have no problems when adding data using sql inserts when I identify national data with N'string'.

    Client application does the following:

    A empty recordset is fetched into ADODB.Recordset (rsSave) variable.
    rsSave.AddNew
    rsSave("Name").Value = strName ' Name is NVARCHAR2 column
    UpdateRS rsSave

    During update I get the error message.

    Thank you for any advice you may offer,
    Vesa Nopanen
    nopanen@quartal.com

    ( I posted this same message to oracle server usenet newsgroup as well, maybe there is somebody who knows the answer. /Vesku )

  2. #2
    Join Date
    Nov 2001
    Location
    Finland, Kirkkonummi
    Posts
    17
    Hello.

    Since I found a some kind of solution I though I'd better post it here as well.

    Instead of a Oracle ODBC I used OraOLEDB.Oracle driver, not forgetting the parameter PLSQLRSet=1 to support Result Sets returned by stored procedures.
    That solution worked perfect with a test program. But I still had the same error (character set mismatch) with our real application. Our application is built on several layers and one layer is handling all sql and procedure calls to server (just the interface). What I found out is that we use disconnected recordsets when we access database.

    So my guess is that you can't use disconnected recordsets with Oracle if you want to update the recordset data later. Maybe it'll work with Oracle 9 but I don't have a Oracle 9 server to test it.

    Vesku

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •