[Gambas-user] Gambas "Best Practices"
Stephen Bungay
sbungay at ...981...
Mon May 26 21:10:53 CEST 2008
I'll see if I can find the code and post it.
charlesg wrote:
> I too have been messing around with this. I loaded 20,000 stock records into
> sqlite3 and used my search method on the 50char max non-indexed description
> field. Bit tedious it was.
>
> Things got much snappier with the following although I agree with Stephen
> that you would have to watch performance in a large environment (fortunately
> not my problem!) because of the repeated calls to the database engine . By
> the 3rd digit, the search had caught up and displayed the result.
> '-------------------------------------------------------------------
> PUBLIC SUB txtDesc_KeyRelease()
> DIM txtUpper AS String
> lstBox.Clear
> txtUpper = UCase(txtDesc.text)
> sql = "select * from stmaster where st_desc like '%" & txtUpper & "%'"
> res = conn.Exec(sql)
> FOR EACH res
> lstBox.Add(res!st_code & "," & res!st_desc)
> NEXT
> END
> '-------------------------------------------------------------------
>
> I agree with Richard that there is a need to help newcomers (like myself)
> particularly on the now non-Francophone side of the divide! I must say I
> find bits of code a great help rather than a bland description of procedure.
>
More information about the User
mailing list