MapwinGIS + ESRI sde/sql database


Does anyone know how to connect to a SDE/SQL database. I have tried 2 different ways of connecting to sde
ConnStr1 = “SDE:” & GISServer & “,5151,sde,” & GISUser & “,” & GISPassword & “, sde.ldr.” & rs!LayerFileName
ConnStr1 = “SDE:server=” & GISServer & “;Port=5151;DATABASE=” & GISDatabase & _
“;User=” & GISUser & “;Password=” & GISPassword

Both do not work and return false when trying to connect

I can connect via MSSQL, however it does not seem to be able to read the projection when using this method. I assume it is because the files required are named as follows: SDE_geometry_columns and SDE_spatial_references and the fields are different to the straight SQL database
ConnStr = “MSSQL:server=” & GISServer & “;DATABASE=” & GISDatabase & _
“;UID=” & GISUser & “;PWD=” & GISPassword
strSQL = “Select * from ldr.” & rs!LayerFileName


Colleen Crawford

Hello Colleen.

I’m not sure where you got the SDE prefix. Is that on the GDAL site? I did find this driver on GDAL. Unfortunately, it looks like it requires a custom build to include the ArcObjects driver, and may also require something like the ArcObjects developer kit. Are you able to do that?


Sde is the name of the database. There are actually 2 database - sde and cgis - almost exactly the same except cgis does not have the projection tables. I will look into this driver. Not sure about ArcObjects developer kit - i will have to ask the GIS dept when they get back from leave.

As I can link to the databases as SQL databases does this make any difference to the speed. I do have a way around it - I just have to add the background as a shape file with the.prj file and then all the other SQL layers load in the correct plcae. I am not sure what the benefit is of using sde over sql.