SQLiteCache: Failed to prepare statement


i just installed your new 5.0 32-bit release and opened my recent MS-Access project containing a Form with a map control, but only loading that form, - that worked so far with release 4.9.3 crashes MS-Access.

after some lines in the Form.Load procedure, where i just set callback and stop-Objects i get messages from the callback-object:

Callback / ErrorMessage: SQLiteCache::DoCaching: Failed to prepare statement.
Callback / ErrorMessage:

  • without having set anything about caching.
    And it crashes finally when i try to define my own tileprovider with this line:

call Me.MapMain.Tiles.Providers.Add(lngWMST_CUSTOM_PROVIDER_ID, “localWMST”, strWMST_Url, tkTileProjection.SphericalMercator, intWMST_Min_Zoomlevel, intWMST_Max_Zoomlevel)

that worked as i wrote so far very well.

When i try to evaluate the last errormessage, i get these results:

Me.MapMain.ErrorMsg(Me.MapMain.LastErrorCode) --> “No Error”

–> RunTime Error ‘-2147319779 (8002801d)’: Automatization error, Library not registerd’

Has there been an API-Change regarding tile-/tileprovider-handling?


We did make some changes to the retrieving of the data. We’re now better using libCurl.
But it should not break existing code.

Is your WMS available so we can try to reproduce and debug?

As i wrote, the statement to set my local WMST-Server wasn’t executed, and after looking a bit more into it, i found, that Access crashed even without execting this statment. I just had to wait a bit with a halt-point on that code line.
So it was simply this error message: SQLiteCache: Failed to prepare statment
that appeared xx-times in the immediate window that got the program crashing.

But what does this: “Library not registered” mean?

I searched the registry, but it seems to be the same GUID for MapWingis 5.0 as with 4.9.3.
I used regsvr32 to reregister the ocx-component, and it succeeded, but no change with Access.


We use the same GUID because there are (or at least shouldn’t be) any breaking changes.
So the new version should replace the previous version.
Perhaps we did that wrong and we should use different GUIDs. I’m not sure anymore :wink:

I also don’t know what Library not registered means. If you can find MWGis in Access it should mean it is registered properly. Perhaps another library is giving this error?

Could you try uninstalling all versions of MapWinGIS (close Office and Visual Studio first) and running this command afterward: regsvr32 /u MapWinGIS.ocx This command should have run during the installation of the new version.
You did install as an Admin?

Could you now check the registry again? All references to MapWinGIS should be gone.
Now install v5 again, make sure you’re running as an admin (right click on the installer and choose Run as ...)

Unregistered 5.0 manually / Uninstalled 5.0 / cleaned anything from Registry i could find (but there wasn’t anything to be found, - very clean uninstall it seems) / reinstalled 5.0 / reregistered manually.
– all done as admin

  • Nothing changed - still get the same error messages and Access crashes reliably shortly after.

will try to setup a clean, new project, let’s see what happens

Created a new database with a single form containing only a map-Control, adding a tileprovider and i get the same error messages and a crashing MS-Access.

i can see no option to attach a file, - so nothing i can share.

you can find it here at the end of that thread

Do you have a crash also when you use the default OSM tiles provider?
I just checked my MW5 plug-in and I have no problems using a custom tile server:

Do you also have MW5 installed? If so could you try to add your tile server as a custom TMS server?
Or can you configure your tile server so it can, temporarily, be used outside your pc so we can try to debug?

the sample database (see above) only uses the OpenStreetmap Tileprovider, not a custom one, and crashes reliably.


just downloaded the development branch and build it in VS 2017, registered it successfully with regsvr32 and created a new MS-Access-DB with a form & MapControl.

The error “SQLiteCache::DoCaching: Failed to prepare statement” as mentioned above doesn’t appear, but as before, first time i try to access .Tiles Class, i get this error:

Library not registered. / -2147319779

–> the error appeared also after this SQLiteCache-Error, so maybe this is the real source of the error

as i wrote: regsvr32 (used both references (system32/syswow64)) claimed SUCCESS when registering, and creating a mapcontrol in the form worked without error messages.

Thanks for any hint



I usually get SQLite errors when MapWindow5 is trying to store the cache in a location the user has no write permissions for. Verify where the sqlite db file is located and make sure you have read/write permissions

Hi Mathijs,

Jerry Faust already solved the mystery with the unregistered library, see here:

and it seems strange, that this behaviour changed from 4.9.xx releases to 5.0, - anyway.

The crashing access application is still a problem.

Thanks and regards

Hi Stefan,

Is your access application still crashing with the latest version of MapWinGIS?