FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How can I correct Korean Alphabet broken in calling MSSQL ?
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Fri Sep 04, 2015 04:56 AM
Dear Sirs,

In general..., there was no problem in using Korean Alphabet with Fivewin/Harbour..

But, when I tried to use MSSQL (or "ADODB.Connection"), the Korean Alphabet were broken like followings...

http://pharmalink.kr/images/mssql_msg.jpg

It should be look like followings.

http://pharmalink.kr/images/mssql_msg2.jpg

The source codes was as followings..
Code (fw): Select all Collapse
#Include "FiveWin.ch"

Func Main()
Local xConnect
Local oRs,cSql, oCn

xConnect := 'Provider=SQLOLEDB.1;Password=1234;Persist Security Info=False;User ID=sa;Initial Catalog=PMLIST;Data Source=PC\SQLEXPRESS'
oCn  := CREATEOBJECT( "ADODB.Connection" )
oCn:Open( xConnect )

oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType     := 1
oRs:CursorLocation := 3
oRs:LockType       := 3

cSQL := "SELECT * FROM CUSTOMER ORDER BY code"

oRs:Open( cSQL, oCn )

? 11, oRs:Fields( "NAME" ):Value   <--- the value was broken..

oRs:Close()
oCn:Close()
Return(.t.)

Please kindly help to resolve this problem..

Thanks..

Y.W.Kim
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Fri Sep 04, 2015 09:05 AM
Dear Mr. Antonio...

It seems to be "In-OUT" of Korean Alphabet..
With same source, when I call Query for numeric filed data, there is no problem...

But, when I call by field with Korean alphabet, there is error (no search result?)...
Even if I call the Korean alphabet field by English alphabet, error happen...

http://pharmalink.kr/images/mssql33.jpg

How can I solve this?
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Fri Sep 04, 2015 09:08 AM

Kim,

I just forwarded your question to Mr. Rao as he is our SQL expert

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Fri Sep 04, 2015 12:58 PM

Kim

Put xBrowse( oRs ) after you open your table and review the results ..

Rick Lipkin

Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Fri Sep 04, 2015 03:15 PM
Thanks...for your supports...

Following is two screen shots...
Code (fw): Select all Collapse
cSQL := "SELECT code, iscode,num, name FROM CD_PERSON where num like '580313%' "
oRs:Open( cSQL, oCn )


http://pharmalink.kr/images/num_no.jpg

I did query by numeric code file "num", since Query with "name" field, Korean alphabet , generate error.

Code (fw): Select all Collapse
cSQL := "SELECT code, iscode,num, name FROM CD_PERSON where num like '580313%' "
oRs:Open( cSQL, oCn )
xBrowse(oRs)


http://pharmalink.kr/images/num_Xbrow.jpg

Following is the error message when I did query with Korean Alphabet..
Code (fw): Select all Collapse
cSQL := "SELECT code, iscode,num, name FROM CD_PERSON where name='홍길동' "


error message
Code (fw): Select all Collapse
Application
===========
   Path and name: E:\FWH\FWH32\samples\mssql11.exe (32 bits)
   Size: 3,106,304 bytes
   Compiler version: Harbour 3.2.0dev (r1501292255)
   FiveWin  Version: FWH 15.05
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 09/04/15, 23:34:21
   Error description: (DOS Error -2147352567) WINOLE/1007  BOF or EOF was .t. , or current record was deleted. "Current record" is required for requested work.. (0x800A0BCD): ADODB.Field

Stack Calls
===========
   Called from:  => TOLEAUTO:VALUE( 0 )
   Called from: mssql11.prg => MAIN( 22 )

System
======
   CPU type: Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz 1700 Mhz
   Hardware memory: 3718 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 6
      1 ,                                                                                                     
      2 , C:\Program Files (x86)\Samsung\Settings\CmdServer\WinCRT.dll                                        
      3 , C:\windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9200.16658_none_bf135 
      4 DDE Server Window, C:\windows\SYSTEM32\OLE32.DLL                                                                       
      5 GDI+ Window, C:\windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9200.16518_none_ba1cf6b7e09f19 
      6 작업 전환, E:\FWH\FWH32\samples\mssql11.exe                                                                    

Variables in use
================
   Procedure     Type   Value
   ==========================
   TOLEAUTO:VALUE
     Param   1:    O    Class: ERROR
   MAIN
     Local   1:    U    
     Local   2:    U    

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 WIN_OLEAUTO
     5 TOLEAUTO
     6 TREG32

Memory Analysis
===============
      324 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Fri Sep 04, 2015 03:49 PM
Kim

Use Try\Catch to test if the recordset opens without error ..

Rick Lipkin

Code (fw): Select all Collapse
#Include "FiveWin.ch"

Func Main()
Local xConnect
Local oRs,cSql, oCn,oErr

xConnect := 'Provider=SQLOLEDB.1;Password=1234;Persist Security Info=False;User ID=sa;Initial Catalog=PMLIST;Data Source=PC\SQLEXPRESS'
oCn  := CREATEOBJECT( "ADODB.Connection" )
oCn:Open( xConnect )

oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType     := 1
oRs:CursorLocation := 3
oRs:LockType       := 3

cSQL := "SELECT * FROM CUSTOMER ORDER BY code"

Try
   oRs:Open( cSQL, oCn )
Catch oErr
   MsgINfo( "Error opening Customer Table" )
   Return(.f.)
ENd Try

xBrowse( oRs )


? 11, oRs:Fields( "NAME" ):Value   <--- the value was broken..

oRs:Close()
oCn:Close()
Return(.t.)
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Sat Sep 05, 2015 01:27 AM
Dear Sirs,

I think there might be Character-set problem..

So, I inserted following sentence to see structure , characterset..

Code (fw): Select all Collapse
cSQL:="SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='dbo' AND TABLE_NAME='PERSON'"


And, get following structure..
Please see CHARACTER_SET_NAME,COLLATION_NAME with horz. scroll.

http://pharmalink.kr/five/STRU.jpg

Full structure
http://pharmalink.kr/five/STRUCTURE.xls

Please kindly inform me how to do..

Thanks.. Teachers...
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Sat Sep 05, 2015 07:12 AM
Kim,

You should use the N' prefix to indicate that you're searching for a Unicode string:

SELECT * FROM dbo.tblArticle WHERE name LIKE N'%......%'
Otherwise, you're converting your search string back to non-Unicode and then searching....


http://stackoverflow.com/questions/11258129/sql-server-search-in-nvarchar-ntext
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Sat Sep 05, 2015 11:51 AM

Thanks.. Mr.Antonio Linares...

I've tried "N" prefix already...
But, there was no change...

it there other option?

Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Sat Sep 05, 2015 12:25 PM
Mr.Antonio,

I've just compiled my source file with xHarbour...

And... I found that there is no "???????"...with Korean alphabet...

The only thing I've done was "replacement "HBZIP.LIB" with old version of HBZIP.lib"
since there was following error with recent HBZIP.LIB..
Code (fw): Select all Collapse
Error: Unresolved external '__ltolower_lcid' referenced from E:\FWH\XHB32\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external '__ltoupper_lcid' referenced from E:\FWH\XHB32\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::_Locinfo::_Locinfo(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' referenced from E:\FWH\XHB32\LIB\HBZIP.LIB|ziparchive


As I asked on http://forums.fivetechsupport.com/viewtopic.php?f=3&t=29012
I replace HBZIP.LIB ( 1,019,904 bytes) with older version HBZIP.LIB (825,856byte, 2013.Oct.7) .

Is it possible to know what is the reason for this difference?

Y.W.Kim
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Sun Sep 06, 2015 02:09 AM

Dear Sirs,

As mentioned abode, in Harbour, Korean Alphabet was broken in MSSQL (or "ADODB.Connection"),?,
but, in xHarbour, it was possible to use Korean Alphabet in MSSQL (or "ADODB.Connection")..

Where is the difference ?

Thanks...

Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Tue Sep 08, 2015 01:44 AM

Kim, I'm just guessing here but you might want to have a look at codepage - http://harbourlanguage.blogspot.my/2010 ... epage.html

HTH

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Tue Sep 08, 2015 04:43 AM

Dear Hua,

Thanks so much for your comment...
And, I have visited the page according to your advice...
Even in my point of view, It was the information related to my problem...

But, I am only beginner.., it was difficult for me to use ...

Mr.Antonio,
Is there service to linking certain needs with person who can solve problem?
(with reasonable payment when required ..)

Mr.Hua,
Thanks so much for your advice....

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Tue Sep 08, 2015 06:48 AM

Kim,

You were talking about SQL and then you start talking about hbzip

How are they related ?

You don't need to pay for tech support as these forums are free for FWH users :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 57
Joined: Sun Apr 12, 2009 10:51 AM
Re: How can I correct Korean Alphabet broken in calling MSSQL ?
Posted: Tue Sep 08, 2015 09:17 AM

Mr.Antonio Linares,

Thanks for your comments.. :lol:

What I hope to solve is MSSQL matter...

I mention that , [u:2mfj5z8j]with same codes[/u:2mfj5z8j], there was no Korean Alphabet problem when compiled with xHarbour..
Through comment of "No problem with xHarbour", I expected some experts may think about problem...

Due to other works done already, I hope to use Harbour/FWH instead of xHarbour/FWH.

Please kindly show me the way..

Thanks.

Y.W.Kim