// Open the geodatabase. int hr; Geodatabase geodatabase; if ((hr = OpenGeodatabase(L"../data/ctg94AllDataset.gdb", geodatabase)) != S_OK) { wcout << "An error occurred while opening the geodatabase." << endl; wcout << "Error code: " << hr << endl; return -1; } // Open the ManyFieldTypes table. Table table; if ((hr = geodatabase.OpenTable(L"\\ctg83FDS\\ctg83FCinTopo", table)) != S_OK) { wcout << "An error occurred while opening the table." << endl; wcout << "Error code: " << hr << endl; return -1; } // GetDefitition wcout << "Test GetDefitition:" << endl; string xmlDef; if ((hr = table.GetDefinition(xmlDef)) != S_OK) { wcout << "An error occurred getting the table definition." << endl; wcout << "Error code: " << hr << endl; return -1; } cout << xmlDef << endl;
thanks your reply
I am confused. I get this XML reading the ExecuteSQL-cities gdb sample from the sdk.
It have not WKT and WKID info and Table::getDefinition returns me the -2147211775 error code.
All samples from SDK and my gdbv10 files return equals.
why ¿?
I use the beta release 2.
my code...
std::wstring tempString = L"";
Helper_MarshalString(tableName, tempString);
m_pDatabase = database->m_pDatabase;
m_pTable = new FileGDBAPI::Table();
long hr = m_pDatabase->OpenTable(tempString, *m_pTable);
if (hr==S_OK) return false;
std::string tempString2 = "";
long hr = m_pTable->GetDefinition(tempString2); //-> ### ERROR -2147211775
tempString2 has XML content but NO WKT info!
all samples and my FGDB files (Imported in ArcCatalog 10 from shapefiles) return this error.
Sorry my bad english!
Thank you very much
std::wstring tempString = L""; Helper_MarshalString(tableName, tempString); m_pDatabase = database->m_pDatabase; m_pTable = new FileGDBAPI::Table(); long hr = m_pDatabase->OpenTable(tempString, *m_pTable); if (hr==S_OK) return false; <- this is incorrect. std::string tempString2 = ""; long hr = m_pTable->GetDefinition(tempString2); //-> ### ERROR -2147211775
if (hr != S_OK) return false
if(hr==S_OK) return falsethe code will only continue executing if OpenTable fails. Any results from the GetDefinition is an error.