ADO: filter does not work on memo fields [fixed]
ADO: filter does not work on memo fields [fixed]
Hi,
Performing a filter on ADO (oRs:Filter) using LIKE on a memo field does not work.
Is there a way?
Thank you.
Performing a filter on ADO (oRs:Filter) using LIKE on a memo field does not work.
Is there a way?
Thank you.
Last edited by MOISES on Sat Feb 15, 2020 4:33 pm, edited 1 time in total.
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Re: ADO: filter does not work on memo fields
Moises:
It Works fine to me.
Show us your code, pls.
Regards
It Works fine to me.
Show us your code, pls.
Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Re: ADO: filter does not work on memo fields
Armando,
This is the code:
It works except on memo fields.
Thank you.
This is the code:
Code: Select all
cFiltro := cCampo + space(1) + "LIKE" + space(1) + "'%"+alltrim(cLiteral)+"%'"
Thank you.
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Re: ADO: filter does not work on memo fields
Moises:
This is may code, the CLI_NOM field is a TEXT type field.
Regards
This is may code, the CLI_NOM field is a TEXT type field.
Code: Select all
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.)
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Re: ADO: filter does not work on memo fields
Yes, in text fields works, but not in memo fields, where I have the issue.
Thank you.
Thank you.
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Re: ADO: filter does not work on memo fields
Up!
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: ADO: filter does not work on memo fields
There is not Memo Field type in any sql database, MSAccess, MySql or MSSql
In MSAccess, MySql, MSSql the field type is TEXT.
In Oracle the field type is also called CLOB
In MSAccess, MySql, MSSql the field type is TEXT.
In Oracle the field type is also called CLOB
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: ADO: filter does not work on memo fields
Yes, I mean long text or blob fields.
In such fields, this line does not work:
In such fields, this line does not work:
Code: Select all
cFilter := cFieldName + space(1) + "LIKE" + space(1) + "'%"+alltrim(cUserText)+"%'"
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: ADO: filter does not work on memo fields
In our tests, filters on LONGTEXT fields are working.
This is the test program:
This is the test program:
Code: Select all
#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
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: ADO: filter does not work on memo fields
My mistake: I was using oBrw:oRs instead of oRs with all fields.
Thank you.
Thank you.
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40