Green Fields wrote:
> conn.EnableExtensions(true);
> conn.LoadExtension("mod_spatialite");
>
> works fine, but I need to use the SQL function
>
> conn.EnableExtensions(true);
> cmd.CommandText = @"SELECT load_extension('mod_spatialite');");
> int i = cmd.ExecuteNonQuery();
>
> raises
>
> System.Data.SQLite.SQLiteException : SQL logic error or missing database
> not authorized

The documentation for sqlite3_enable_load_extension() says:
> This interface enables or disables both the C-API
> sqlite3_load_extension() and the SQL function load_extension(). Use
> sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION,..) to
> enable or disable only the C-API.
<http://www.sqlite.org/c3ref/enable_load_extension.html>

EnableExtensions() call sqlite3_db_config() and not
sqlite3_enable_load_extension().  Apparently, forbidding loading
extensions from SQL is done on purpose.


You could create a user-defined function to call LoadExtension(), but
why do you need to do this from SQL?


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to