Нашли опечатку? Выделите ее мышкой и нажмите Ctrl+Enter
Название: Access 2007 Programming by Example with VBA, XML and ASP
Автор: Korol J.
In particular, the chapter on Arrays. Most books skip this topic entirely or will have a page or 2. This has an entire chapter on it, with many "complete" examples, and the reason I bought the book. This may, in fact, be the definitive reference for arrays. But there is a remarkable error in that chapter, which describes how, for 2D arrays, the first index is for rows, the second for columns, such as Array(rowindex,columnindex). But I discovered, after a few hours of confusion, that it's the other way around! The problem is evident from the continuous "out of range" errors I was getting. I had to print.debug almost every cell in my array to confirm this. Also, the SELECT statement in the example that uses the GetRows Method to fill a 2D array (ironically not in the chapter on Arrays) should include the ORDER BY clause, so the data in the array will be in the same order as in the table from which it's importing. I was printing the table, for reference, but the array was, not obviously, sorted in a different order! For sure, the code in these books often doesn't work, but I'm sure it's hard to proof all the code, since typos in code just aren't as obvious as with regular prose.