[Gambas-user] Datasource.Filter does not work
B Bruen
bbruen at ...2308...
Thu Nov 6 23:05:43 CET 2014
On Thu, 6 Nov 2014 16:04:33 -0500
"Martin McGlensey" <mmcg29440 at ...3163...> wrote:
> Hello,
(snipo)
> Now further down in a sub login.Filter = "User = " & txtLogin.Text, where
> txtLogin.Text = "Marty", I get "query failed, unknown column 'Marty' in
> where clause"
>
The error ypu are reciving is correct. You need to delimit the string in the filter:
login.Filter = db.Subst("User = &1", txtLogin.Text)
otherwise your filter string will look like "User = Marty".
gb.db.Subst will wrap the Marty string in the proper delimiters for the database being used eg for postgresql the filter would result in:
"User = $$Marty$$".
hth
Bruce
--
B Bruen <offline currently>
More information about the User
mailing list