How to use RefreshSchemaCache (VBA) ?

536
2
06-29-2010 04:45 AM
ChristopheDAMOUR
New Contributor
Hi,

I am having problems with Access standalone tables structure not being updated.

I found the following advice in the old forum :
- Open your workspace.
- Cast the workspace factory to the IWorkspaceFactorySchemaCache interface.
- Call IWorkspaceFactorySchemaCache.RefreshSchemaCache, passing your workspace in as a parameter.

I tried to to that in VBA as follow, but I get a "Method or data member not found" error :
    Dim pFactWorkSpace As IWorkspaceFactory
    Set pFactWorkSpace = New OLEDBWorkspaceFactory
    Dim pWorkSpace As IWorkspace
    Set pWorkSpace = pFactWorkSpace.Open(pPropset, 0)

    'Dim pWorkspaceFactorySchemaCache As IWorkspaceFactorySchemaCache
    'Set pWorkspaceFactorySchemaCache = pFactWorkSpace
    'pWorkspaceFactorySchemaCache.RefreshSchemaCache (pWorkSpace)


Thanks for any hint.
0 Kudos
2 Replies
AlexanderGray
Occasional Contributor III
If you look at the help for IworkspaceFactoryschemacache, it is only implemented for SDEworkspacefactory.  You are using an OLEWorkspaceFactory...

The schema cache is only meant for sde schema caching.
0 Kudos
ChristopheDAMOUR
New Contributor
Thank you very much for your answer, agray1.

Do you know if there is any other way to refresh database tables structure ?

--
Christophe
0 Kudos