Select to view content in your preferred language

Cannot open the Geodatabase

2920
1
08-04-2011 03:19 AM
PrateekBansal
New Contributor
Hi , I have created a vc++ clr console Application that uses FileGDBAPI and reference to System.Data.SqlClient The problem is when ever I am trying to open the geodatabase using

if ((hr = OpenGeodatabase(wstring(L"C:\Users\Dev\Desktop\Index\Henrico.gdb"), geodatabase)) != S_OK)
  {
    wcout << "An error occurred while opening the geodatabase." << endl;
    ErrorInfo::GetErrorDescription(hr, errorText);
    wcout << errorText << "(" << hr << ")." << endl;
    return -1;
  }
I get This error
"An unhandled exception of type 'System.AccessViolationException' occurred in RoadIndexApp.exe

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

can anybody help me out as I am really stuck .

Thanks
0 Kudos
1 Reply
LanceShipman
Esri Regular Contributor
One possibility is that you are linking with /MT or /MTd instead of /MD or /MDd. This can result in the error that you are seeing.
0 Kudos