ESE(可扩展存储引擎)JetSetIndexRange似乎不像宣传的那样工作 [英] ESE (Extensible Storage Engine) JetSetIndexRange doesn't seem to work as advertised
问题描述
我有一个ESE数据库。其中一个键构造如下:
I have an ESE database. One of the keys is constructed as follows:
- DWORD
- DWORD
- Unicode字符串(最大32K)
- Unicode string (max 32K)
当我使用JetSeek定位光标时,它工作正常。下一次读取是在正确的记录。
When I use JetSeek to position the cursor, it works fine. The next read is at the correct record.
我正在编写代码来删除与DWORD字段中特定数字相对应的记录。该字符串是一个通配符。
I am writing code to delete records that correspond with a specific number in the DWORD field. The string is a wildcard.
我发现当我调用JetSetIndexRange时,它会将当前光标位置重置到表的开头!索引范围设置为范围的结尾。
I find that when I call JetSetIndexRange, it will RESET the current cursor position to the start of the table! The index range is set as far as the end of the range.
我尝试了使用JetMakeKey / JetSeek / JetMakeKey / JetSetIndexRange的所有不同排列,它们的工作原理相同。如果我不包含JetSetIndexRange,则游标会启动正确的条目,但会一直运行直到它到达表的末尾。
如果我指定一个索引范围,它从表的开头开始并在范围的结尾处结束。
I've tried all different permutations of using JetMakeKey/JetSeek/JetMakeKey/JetSetIndexRange and it all works the same. If I don't include JetSetIndexRange, the cursor starts a the correct entry, but will keep going until it gets to the end of the table. If I specify an index range, it starts at the start of the table and ends at the end of the range.
我在调用JetSetIndexRange时使用JET_bitRangeUpperLimit,因为我我从表的开始到结束。任何想法将不胜感激。
I am using JET_bitRangeUpperLimit in the call to JetSetIndexRange because I am going from the start of the table through to the end. Any ideas would be appreciated.
谢谢,
Bob
Bob
推荐答案
啊。愚蠢的错误。我正在重复使用为JetSeek组装密钥的代码,用于JetSetIndexRange。问题是在那里调用了JetSetCurrentIndex。这对JetSeek来说是正确的,但是当它再次被JetSetIndexRange调用时,它具有重置前一个搜索的
效果。
Ah. Stupid bug. I was reusing the code that assembles the key for JetSeek, for JetSetIndexRange. The problem was there was a call to JetSetCurrentIndex in there. That was correct for JetSeek, but when it was called again for JetSetIndexRange it had the effect of resetting the previous seek.
这篇关于ESE(可扩展存储引擎)JetSetIndexRange似乎不像宣传的那样工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!