M
Mark
Hi - I have set-up security for my users - the security is held in a
text field, separated by a comma.
If the users a member of groups 1, 5 and 6 - the usergroups field is set
to 1,5,6 - to check if they are allowed access to the books, I need to
check each of these numbers (by using split,"," and building a SQL
statement - this needs to check against the membergroups of each book
title - which again is set as a text field - eg. "2,3,4,5"
The Select statement to show users book titles they are allowed to see
should be:
select id, titles, authors from tblbooks where (1 in (membergroups) OR 5
in (membergroups) or 6 in (membergroups))
...the error I get though is 'Syntax error converting the varchar value
'2,3,4,5' to a column of data type int.
If I change it to:
select id, titles, authors from tblbooks where ('1' in (membergroups) OR
'5' in (membergroups) or '6' in (membergroups))
...I don't get any errors, but I don't get any results either - any
ideas? Thanks a lot,
text field, separated by a comma.
If the users a member of groups 1, 5 and 6 - the usergroups field is set
to 1,5,6 - to check if they are allowed access to the books, I need to
check each of these numbers (by using split,"," and building a SQL
statement - this needs to check against the membergroups of each book
title - which again is set as a text field - eg. "2,3,4,5"
The Select statement to show users book titles they are allowed to see
should be:
select id, titles, authors from tblbooks where (1 in (membergroups) OR 5
in (membergroups) or 6 in (membergroups))
...the error I get though is 'Syntax error converting the varchar value
'2,3,4,5' to a column of data type int.
If I change it to:
select id, titles, authors from tblbooks where ('1' in (membergroups) OR
'5' in (membergroups) or '6' in (membergroups))
...I don't get any errors, but I don't get any results either - any
ideas? Thanks a lot,