Hi,
Performing a filter on ADO (oRs:Filter) using LIKE on a memo field does not work.
Is there a way?
Thank you.
cFiltro := cCampo + space(1) + "LIKE" + space(1) + "'%"+alltrim(cLiteral)+"%'"
STATIC FUNCTION FilNom(oDlg,oBrw,aGets)
cFilNom := ALLTRIM(cFilNom)
IF ! EMPTY(cFilNom)
IF oRsPry:BOF() .AND. oRsPry:EOF()
MsgInfo("No hay obras donde buscar !",oApp:cAplicacion)
ELSE
oRsPry:Filter := "CLI_NOM LIKE " + "'%" + cFilNom + "%'"
IF oRsPry:BOF() .AND. oRsPry:EOF()
MsgInfo("Cliente " + cFilNom + " no localizado !",oApp:cAplicacion)
oRsPry:Filter := adFilterNone
ENDIF
ENDIF
ELSE
oRsPry:Filter := adFilterNone
ENDIF
oBrw:Refresh()
oDlg:Update()
cFilNom := SPACE(40)
aGets[02]:oJump := oBrw
RETURN(.T.)
cFilter := cFieldName + space(1) + "LIKE" + space(1) + "'%"+alltrim(cUserText)+"%'"
#include "fivewin.ch"
function Main()
local oCn, cSql, oRs
oCn := FW_DemoDB( "ADO" )
TRY
oCn:Execute( "DROP TABLE testmemo" )
CATCH
END
TEXT INTO cSql
CREATE TABLE testmemo (
id INT AUTO_INCREMENT PRIMARY KEY
,name VARCHAR(10)
,memo LONGTEXT
)
ENDTEXT
oCn:Execute( cSql )
TEXT INTO cSql
INSERT INTO testmemo ( name, memo ) VALUES
( "AAA", "one two three" ),
( "BBB", "three four five" ),
( "CCC", "five six seven" )
ENDTEXT
oCn:Execute( cSql )
oRs := FW_OpenRecordSet( oCn, "testmemo" )
? oRs:RecordCount() // ----------------------> 3
oRs:Filter := "MEMO LIKE %three%"
oRs:MoveFirst()
? oRs:RecordCount() // ----------------------> 2 : Filter success
oRs:Close()
oCn:Close()
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 44 guests