In ASP there is a SERVER.HTMLencode (IIRC) functionIn case its any help here's how I do URL Encode in SQL (as a function)CREATE FUNCTION dbo.kk_FN_URLEncode( @strInput varchar(8000))RETURNS varchar(8000)/* WITH ENCRYPTION */AS/* * kk_FN_URLEncode Encode value to be used as URL (i.e. substitute reserved characters with %nn) * * Returns: * * Encoded Content * * HISTORY: * * 19-Jun-2004 KBM Started */BEGIN IF @strInput IS NULL BEGIN -- Just return NULL if input string IS NULL RETURN NULL END SELECT @strInput= REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( REPLACE(REPLACE( @strInput, CHAR(10), '%0A'), CHAR(13), '%0D'), ' ', '%20'), ':', '%3A'), ';', '%3B'), '-', '%2D'), '/', '%2F'), '\', '%5C'), '!', '%21'), '"', '%22'), '#', '%23'), '?', '%3F'), '=', '%3D'), '@', '%40'), '%', '%25'), '>', '%3E'), '<', '%3C'), '$', '%24'), '&', '%26'), '[', '%5B'), ']', '%5D'), '~', '%7E'), '^', '%5E'), '`', '%60'), '{', '%7B'), '}', '%7D'), '|', '%7C') RETURN @strInputENDKristen