Just a quick note while I'm thinking of it...with the relatively recent support of SDE 9.2 the style has changed to use a plug-in. So if you're looking for a layers connection type in MapScript is will show up as 13 instead of MS_SDE (6 I think?). I don't see a documented constant for the plugiin connection type. Cheers, Josh Hevenor