Operate on empty table

1614
4
02-16-2012 04:04 AM
ArturRedzko
New Contributor
When I check a table extent using ltable->GetExtent(), for empty layer I get NAN values. This is fine as it's easy to check. But when I make first reading using ltable->Search(...,enumrows) , then at enumrows->Next() I get access violation at 54D8D99E in FileGDBAPID.dll (Read of address 00000000) exception. How can I avoid this error? How to check if Search returns EOF so I can skip Next? I assume that these functions should return a result code to notify EOF what works fine for not empty layers. Is this a bug in SDK?

Regards
Artur
0 Kudos
4 Replies
DavidSousa
New Contributor III
If a call to Next does not return a row, it returns S_FALSE to indicate that fact.  This is the expected behavior.

I don't know why you are getting an access violation.  This will require some investigation.
0 Kudos
ArturRedzko
New Contributor
My fault. I didn't check that I tried to operate on Table, not on Feature Class returned from GetChildDatasets(). So as you wrote for Feature Class if a call to Next does not return a row, it returns S_FALSE to indicate that fact. But why it fails for Table type ?

Artur
0 Kudos
DavidSousa
New Contributor III
There should be no difference in the behavior of Next() between a table and a feature class.

What are the steps to reproduce this problem?  This is not something that we have seen in the past.
0 Kudos
ArturRedzko
New Contributor
1. having a table name from GetChildDatasets I use OpenTable on "Table" dataset type
2. Then make a Search with Envelope on this table to get enum rows
3. Then make Next on enum rows - here AV occurs

The same scenario works fine for "Feature Class" dataset type.
0 Kudos