I am trying to set a sql filter to numeric expression against a numeric field and getting a run-time error as a character string ..
Tell me what I am doing wrong :
- Code: Select all Expand view
oRsProp:Filter := ""
if oRsProp:eof
return(.f.)
endif
oRsProp:MoveFirst()
oRsProp:Filter := "address = '"+alltrim(str(nFIND))+"'"
msginfo( "address like '"+alltrim(str(nFind,0))+"%'" )
IF oRsProp:eof
oRsProp:Filter := ""
oRsProp:Filter := "address like '"+alltrim(str(nFind,0))+"%'" // error here
ENDIF
Application
===========
Path and name: C:\Fox\Yacht\YachtW32.Exe (32 bits)
Size: 2,140,160 bytes
Time from start: 0 hours 0 mins 13 secs
Error occurred at: 09/15/2011, 17:40:56
Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: _FILTER
Args:
[ 1] = C address like '1%'
Stack Calls
===========
Called from: source\rtl\win32ole.prg => TOLEAUTO:_FILTER(0)
Called from: PropBrow.prg => _LOOKUP(303)
Called from: PropBrow.prg => (b)_PBROW(245)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(445)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(631)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1469)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1295)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(966)
Called from: Main.prg => MAIN(264)