0 Replies Latest reply on Dec 4, 2003 1:34 AM by 410383

    Use OO4O insert chinese words all become question mark(?)

    410383
      I use ADO insert chinese words is ok.
      When I replace ADO with OO4O...
      All chinese words insert into DB will become question mark(?)....
      The same code may work well on some cumputer..others not..
      I had modify NLS_LANG to TRADITIONAL CHINESE_TAIWAN.ZHT16MSWIN950 or AMERICAN_AMERICA.ZHT16DBT , but does not work .

      DB SET:
      NLS_NCHAR_CHARACTERSET = ZHT16DBT
      NLS_CHARACTERSET = ZHT16DBT
      NLS_LANGUAGE = AMERICAN
      Work normal PC SET : AMERICAN_AMERICA.ZHT16DBT

      The programs are as follows:
      Public Function connectDB01() As Boolean
      On Error Resume Next
      connectDB01= True

      If OraDB.ConnectionOK = False Then
      Err.Clear
      Set OraSession = CreateObject("OracleInProcServer.XOraSession")
      Set OraDB = OraSession.OpenDatabase("db01", "abcd/bcda", ORADB_DEFAULT)
      If Err <> 0 Then
      connectDB01= False
      End If

      OraSQL = "INSERT INTO sysadm.isms_prov_req (SEQNO,BATCH_NO,MSISDN,CONTENT,INSERT_DATE,RETURN_VALUE,MSG_ID,STATE,MODIFY_DATE) VALUES (:SEQNO,:BATCH_NO,:MSISDN,:CONTENT,sysdate,null,null,:STATE,sysdate)"

      With OraDB
      .Parameters.Add "SEQNO", 0, ORAPARM_INPUT
      .Parameters.Add "BATCH_NO", 0, ORAPARM_INPUT
      .Parameters.Add "MSISDN", 0, ORAPARM_INPUT
      .Parameters.Add "CONTENT", 0, ORAPARM_INPUT
      .Parameters.Add "STATE", 0, ORAPARM_INPUT

      .Parameters("SEQNO").serverType = ORATYPE_NUMBER
      .Parameters("BATCH_NO").serverType = ORATYPE_VARCHAR2
      .Parameters("MSISDN").serverType = ORATYPE_VARCHAR2
      .Parameters("CONTENT").serverType = ORATYPE_VARCHAR2
      .Parameters("STATE").serverType = ORATYPE_VARCHAR2

      Set OraInsert = .CreateSql(OraSQL, ORASQL_DEFAULT)
      End With


      End If

      If AdoDb01.State = 0 Then
      AdoDb01.Open "provider=MSDAORA;Password=abcd;User ID=bcda;Data Source=db01;persist security info=true"
      If Err <> 0 Then
      connectDB01= False
      End If
      End If
      End Function

      ADO insert
      AdoDb01.Execute ("INSERT INTO sysadm.isms_prov_req VALUES (" & SEQNO & ",'" & BATCH_NO & "','" & Lists(0) & "','" & FullSMS & "', SYSDATE ,NULL,NULL,'I',SYSDATE)")

      OO4O insert
      With OraDB
      .Parameters("SEQNO").Value = SEQNO
      .Parameters("BATCH_NO").Value = BATCH_NO
      .Parameters("MSISDN").Value = Lists(0)
      .Parameters("CONTENT").Value = FullSMS
      .Parameters("STATE").Value = "I"
      End With

      OraInsert.Refresh
      ======================================================
      Please help...Thanks~.