Ciao a tutti,
ho provato questo codice per una ricerca in un file MDB:
cFind:="K"
oRs:MoveFirst()
Reg:=oRs:Find("Campo1='"+cFind+"'")
msginfo(Reg)
oRs:Absoluteposition:=Reg
il valore restituito in Reg è uguale a nil
dove sbaglio?
Grazie
oRs:Find
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: oRs:Find
Sample code :
oRs:Find always returns nil. If find is successful, it goes to the first row found. If not it goes to eof.
Syntax:
objRecordset:Find( criteria, skiprows, direction, start )
Code: Select all
oRs:Find( cSeekExpr, 0, 1, 1)
if oRs:eof()
lFound := .F.
oRs:MoveLast()
else
lFound := .T.
endif
Syntax:
objRecordset:Find( criteria, skiprows, direction, start )
Last edited by nageswaragunupudi on Wed Apr 15, 2009 3:19 pm, edited 1 time in total.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: oRs:Find
Lisa:
Try this way
Reg:=oRs:Find("Campo1= " + "'" + cFind + "'")
Regards
Try this way
Reg:=oRs:Find("Campo1= " + "'" + cFind + "'")
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
- Lisa Giordano
- Posts: 25
- Joined: Wed Jul 09, 2008 5:56 pm
Re: oRs:Find
Reg restituisce sempre NIL
- Lisa Giordano
- Posts: 25
- Joined: Wed Jul 09, 2008 5:56 pm
Re: oRs:Find
if !oRs:eof() la ricerca ha esito positivo...
nTessera:="0100141411283"
oRs:MoveFirst()
oRs:Find( "CODTES='"+nTessera+"'", 0, 1, 1)
if !oRs:eof()
msginfo(oRs:Fields("CodTes"):Value)
endif
Grazie del suggerimento
nTessera:="0100141411283"
oRs:MoveFirst()
oRs:Find( "CODTES='"+nTessera+"'", 0, 1, 1)
if !oRs:eof()
msginfo(oRs:Fields("CodTes"):Value)
endif
Grazie del suggerimento
- Lisa Giordano
- Posts: 25
- Joined: Wed Jul 09, 2008 5:56 pm
Re: oRs:Find
oRs:Sort :="CodTes"
da errore
Help me
da errore
Help me
Re: oRs:Find
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
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: oRs:Find
>
oRs:Sort :="CodTes"
>
This is correct. Please check your spellings and make sure the field name exists in the recordset.
what error are you getting ?
oRs:Sort :="CodTes"
>
This is correct. Please check your spellings and make sure the field name exists in the recordset.
what error are you getting ?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India