J
javaguy
I'm writing an Access application that will want to grow up and use SQL
Server someday.
I've a logic section in this multi-user app that says: My form was pointing
at this here record, known by its (auto-numbering) key value, that points at
a record in the (possibly filtered) recordset. I will press the "Next
Record" button, which will navigate to the "next" record in the recordset,
based on the current filter (where clauses) and indexes (order by). An
obvious thing to do is to make the recordset settle on that record and then
do MoveNext.
Suppose the "current" record was deleted by some other user. The (auto-
numbering) key value doesn't exist any more, and there is no record to settle
on. So I need some other method here.
I have a way of making this work when the indexes can be reduced to a single
key value:
select * from mytable (where filters) and (keyfield > previous_key_field)
order by keyfield
Suppose now that I want to sequence things by (last_name, first_name). If I
have Adam Smith, Betty Smith and Charley Smith, and I was on the (now deleted)
Betty Smith, how do I arrange things so that the "next" button moves me to
Charley Smith? In its more generic form, I have a form-dependent set of
index fields, and can't hard-code tests on index values ("select ... where
firstfield > firstvalue or (firstfield = firstvalue and secondfield >
secondvalue) or (firstfield = firstvalue and secondfield = secondvalue and
thirdfield...)...
With ADO Seek this is easy, as it honors multi-field indexes and has the
adSeekAfter directive. But I'm constantly informed that I can't combine ADO
Seek and SQL Server, even in its newest versions.
Perhaps I'm missing something important here...
Server someday.
I've a logic section in this multi-user app that says: My form was pointing
at this here record, known by its (auto-numbering) key value, that points at
a record in the (possibly filtered) recordset. I will press the "Next
Record" button, which will navigate to the "next" record in the recordset,
based on the current filter (where clauses) and indexes (order by). An
obvious thing to do is to make the recordset settle on that record and then
do MoveNext.
Suppose the "current" record was deleted by some other user. The (auto-
numbering) key value doesn't exist any more, and there is no record to settle
on. So I need some other method here.
I have a way of making this work when the indexes can be reduced to a single
key value:
select * from mytable (where filters) and (keyfield > previous_key_field)
order by keyfield
Suppose now that I want to sequence things by (last_name, first_name). If I
have Adam Smith, Betty Smith and Charley Smith, and I was on the (now deleted)
Betty Smith, how do I arrange things so that the "next" button moves me to
Charley Smith? In its more generic form, I have a form-dependent set of
index fields, and can't hard-code tests on index values ("select ... where
firstfield > firstvalue or (firstfield = firstvalue and secondfield >
secondvalue) or (firstfield = firstvalue and secondfield = secondvalue and
thirdfield...)...
With ADO Seek this is easy, as it honors multi-field indexes and has the
adSeekAfter directive. But I'm constantly informed that I can't combine ADO
Seek and SQL Server, even in its newest versions.
Perhaps I'm missing something important here...