This project is read-only.

Problem to use ImportFromShapefile

Topics: User Forum
Oct 27, 2006 at 9:31 PM
Hi Ricardo,

I got the following error message when using ST.ImportFromShapefile to populate shapefile:
I used:
"EXECUTE ST.ImportFromShapefile 'shapefile name', '', 'tablename', 'thegeom', -1"

My conf:
Windows 2003 server (x64), .Net 2.0 and MSSQL-spatial Release 0.1.RC3.

Thanks a lot for your help in advance and the MSSQL-spatial is cool !

BTW, I can use "msscmd" utility to import shapefile though ~


The error messages are (it seems to be a security issue)
Msg 6522, Level 16, State 1, Procedure ImportFromShapefile, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'ImportFromShapefile':
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at SharpMap.Data.Providers.ShapeFile.ParseHeader()
at SharpMap.Data.Providers.ShapeFile..ctor(String filename, Boolean fileBasedIndex)
at SharpMap.Data.Providers.ShapeFile..ctor(String filename)
at StoredProcedures.ImportFromShapefileMain(String shapefile, String schemaname, String tablename, String column_name, Int32 srid, String type, String connectionString, Int32& importedRows, TimeSpan& elapsedTime)
at StoredProcedures.ImportFromShapefile(SqlString shapefile, SqlString schemaname, SqlString tablename, SqlString column_name, SqlInt32 srid, SqlString type)
Oct 28, 2006 at 5:08 AM
Did you try msscmd.exe -deploy -deploy_permission=EXTERNAL_ACCESS... ?

Best regards,
Ricardo Stuven.