Exemplo n.º 1
0
void MgdCreateFileFeatureSource::CreateDataStore(
    FdoIConnection* conn)
{
    MG_FEATURE_SERVICE_TRY()
    m_tempFileName = MgFileUtil::GenerateTempFileName(true, STRING(L"tmp"), m_fileExtension); // NOXLATE

    // Create the datastore
    FdoPtr<FdoICreateDataStore> createDsCmd = static_cast<FdoICreateDataStore*>(conn->CreateCommand(FdoCommandType_CreateDataStore));
    FdoPtr<FdoIDataStorePropertyDictionary> dsProp = createDsCmd->GetDataStoreProperties();
    dsProp->SetProperty (m_connectParamName.c_str(), m_tempFileName.c_str());
    createDsCmd->Execute();
    MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgdCreateFileFeatureSource::CreateDataStore")
}
Exemplo n.º 2
0
void ConvertUtil::CreateSQLiteFile(FdoIConnection *connection, FdoString *file)
{
    _wunlink(file);

    int    count = 0;
    wchar_t buffer[512];
    FdoString **names = NULL;
    
    swprintf(buffer, 512, L"File=%ls;UseFdoMetadata=TRUE", file);
    connection->SetConnectionString(buffer);

    FdoPtr<FdoICreateDataStore>    dataStore = static_cast<FdoICreateDataStore*>(connection->CreateCommand(FdoCommandType_CreateDataStore));
    FdoPtr<FdoIDataStorePropertyDictionary> dictionary = dataStore->GetDataStoreProperties();

    names = dictionary->GetPropertyNames(count);
    dictionary->SetProperty(names[0], file);

    dataStore->Execute();
}