"Chris" <(E-Mail Removed)> wrote in message
news:a5333516-1786-40a7-bec8-(E-Mail Removed)...
> Hello.
>
> Following SQL-statement works directly in Access
>
> SELECT * FROM Users_ as U, Courses as C
> WHERE (U.course_id = @course_id or @course_id is null)
> AND U.Course_id = C.Course_id
> <etc>
The most probable solution is DBNull.Value instead of Nothing, but I
question the SQL, as it can return two things:
1. A list of all courses that link
2. Only the course that matches
Do you really want everything if there is no match? Think this through. I
know the answer may be yes, at a high level, but the question is in a
particular user story is a bucket o' everything equivalent to a single
course. In other words, should the two not fulfill different requirements.
Example:
User clicks on item on list, ID will always be non-null
(to fill list, however, you just get all or get all by parameter)
User types in particular course id and gets single item
At the point an ID is found, does it not make sense to show the information
differently, including some information that may not make sense in the
original grid?
In your application, I might be off, but I do list/detail type work all the
time and rarely do I find the list and detail working the same way. I would
rather give a "cannot find for that id" than have the user get a list. I can
offer "would you like to see the entire list", but if the user is looking
for something in particular, having him go through everything is not usually
a good option. It is more likely the user will try search again, thus
wasting all of the cycles and reducing the scalability of the app for
nothing.
--
Peace and Grace,
Greg
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
************************************************
| Think outside the box! |
************************************************