SQLRDD SR_SETFILTER() With Some Chinese Word BUG

SQLRDD SR_SETFILTER() With Some Chinese Word BUG

Post by kokooka » Sun, 11 Jan 2009 18:20:22


hi Everyone:

One Chinese Character need 2 bytes is The Difference Between English
Character(1 byte).

Pease look this sample for English Char Search:

**********************
LOCAL cWORD,cCODN

USE ITEM NEW SHARE VIA "SQLRDD"

cWORD:="A"
cCOND:=" RMK LIKE "+ "'%"+cWORD+"%'"
SR_SETFILTER(cCOND) ==> NO Problem
GO TOP
BROWSE()
************************

But in some Chinese Word ,Sr_setfilter() had bug
Sample for Chinese Char Search:
**********************
LOCAL cWORD,cCODN

USE ITEM NEW SHARE VIA "SQLRDD"

cWORD:="一"
cCOND:=" RMK LIKE "+ "'%"+cWORD+"%'"
SR_SETFILTER(cCOND) ==> error
GO TOP
BROWSE()
************************

Error massage as:
Application
===========
Path and name: D:\PROGRAM\xHarBour\PSS_SQL\PSS_SQL.exe (32 bits)
Size: 5,181,952 bytes
Time from start: 0 hours 0 mins 23 secs
Error occurred at: 2009/01/10, 13:32:39
Error description: Error SR_MYSQL/0 SQLExecDirect Error
(1064) You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ''%? ORDER BY A.`last_date`, A.`sr_recno` LIMIT 102 /* Skip
FWD */' at line 1 - You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ''%? ORDER BY A.`last_date`, A.`sr_recno` LIMIT
102 /* Skip FWD */' at line 1
Command : SELECT A.`date`, A.`sno`, A.`cno`, A.`salman`,
A.`cust_need`, A.`rmk`, A.`miss_man`, A.`done`, A.`time`,
A.`username`, A.`last_date`, A.`point`, A.`edit_done`, A.`update`,
A.`sr_recno`, A.`sr_deleted` FROM `service` A WHERE
( ( A.`last_date` >= '20040603' AND A.`sr_recno` >= 3655) OR
( A.`last_date` > '20040603' ) ) AND ( LAST_DATE>='20000111' AND
LAST_DATE<='20090110' AND DETIL LIKE '%? ORDER BY A.`last_date`,
A.`sr_recno` LIMIT 102 /* Skip FWD */
hStmt :
Steatment handle :
Connection handle :
RetCode : 1064
- RollBack executed.

Stack Calls
===========
Called from: => THROW(0)
Called from: sqlconnection.prg => SR_MYSQL:RUNTIMEERR(857)
Called from: sqlconnection.prg => SR_MYSQL:EXECUTE(618)
Called from: sqlrdd2.prg => SR_WORKAREA:READPAGE(4106)


The problem is cWD(:="一") include a "%" Char in One of the Two bytes.
SQLRDD Transfer Sr_SetFilter("RMK LIKE '%一%'") TO SOME SQL command AS
Sr_SetFilter("RMK LIKE ''%? ).

I need SQLRDD Support , It is a bug. please Help me.