Hi There, I'm trying to perform a querybyattributes call to a sde layer and I get this error Message "msSDELayerNextShape(): SDE error. SE_stream_fetch(): Underlying DBMS error. (-51)" String Does anyone know why. I'm using C# mapscript and ms4w2.2.1. My function does perform a successfull query if my layer is a shapefile! Thanks, DaviD