How can I correct Korean Alphabet broken in calling MSSQL ?

How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Fri Sep 04, 2015 4: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: Select all  Expand view
#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
Last edited by kim yong woo on Fri Sep 04, 2015 9:07 am, edited 1 time in total.
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Fri Sep 04, 2015 9: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?
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby Antonio Linares » Fri Sep 04, 2015 9:08 am

Kim,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby Rick Lipkin » Fri Sep 04, 2015 12:58 pm

Kim

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

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Fri Sep 04, 2015 3:15 pm

Thanks...for your supports...

Following is two screen shots...
Code: Select all  Expand view
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: Select all  Expand view
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: Select all  Expand view
cSQL := "SELECT code, iscode,num, name FROM CD_PERSON where name='홍길동' "


error message
Code: Select all  Expand view
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

User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby Rick Lipkin » Fri Sep 04, 2015 3:49 pm

Kim

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

Rick Lipkin

Code: Select all  Expand view

#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.)

 
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Sat Sep 05, 2015 1:27 am

Dear Sirs,

I think there might be Character-set problem..

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

Code: Select all  Expand view
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...
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby Antonio Linares » Sat Sep 05, 2015 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » 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?
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » 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: Select all  Expand view
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
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Sun Sep 06, 2015 2: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...
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby hua » Tue Sep 08, 2015 1: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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Tue Sep 08, 2015 4: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....
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby Antonio Linares » Tue Sep 08, 2015 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How can I correct Korean Alphabet broken in calling MSSQL ?

Postby kim yong woo » Tue Sep 08, 2015 9:17 am

Mr.Antonio Linares,

Thanks for your comments.. :lol:

What I hope to solve is MSSQL matter...

I mention that , with same codes, 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
User avatar
kim yong woo
 
Posts: 57
Joined: Sun Apr 12, 2009 10:51 am
Location: Seoul, Korea

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests