MS-SQL, ZEOS, Typecasting lazarus / 16-Databases ---------------------------------------------------------------------- Icho2099 · 2021-10-01 12:32 crosspost on www.entwicklerecke.de I'm using ZEOS query with ADO connection to  MS-SQL server, works fine so far but now I want to store geography data using this : Code: MySQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i INSERT INTO [JP].[dbo].[F0116_EXT]( [LOC], [AN8])VALUES ( geography::STPointFromText( 'POINT(3.1172070745378733 39.808602472767234)', 4326) , 99999993 )  Execution of this in management studio works fine but execution via ZEOS query.execsql doesn't Tells me that STPointFromText(...) is invalid. Any idea how to pass this typecast geography::STxxxxx with string parameter via ZEOS/ADO ? ---------------------------------------------------------------------- loaded · 2021-10-01 13:29 With Postgis support in Postgresql; My query, which detects in which cadastral parcel the photographs containing geolocation data were taken, works without any problems. It may be of use to you in terms of query similarity. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var fcenterlon,fcenterlat,fsqlw:String;begin       fcenterlon:='32.493206';       fcenterlat:='37.872938';       fsqlw:=' WHERE ST_DWithin(geom,ST_GeomFromText(''POINT('+fcenterlon+' '+fcenterlat+')'', 4326),0.0011241512657943)'+       ' ORDER BY ST_Distance(GEOM,ST_GeometryFromText(''POINT('+fcenterlon+' '+fcenterlat+')'', 4326))';end; ---------------------------------------------------------------------- marsupilami79 · 2021-10-05 12:53 Hello Icho2099, Quote from: Icho2099 on October 01, 2021, 02:32:51 pmAny idea how to pass this typecast geography::STxxxxx with string parameter via ZEOS/ADO ? The colon ( is used to mark parameters. Please use another ParamChar on TZQuery and TZReadOnlyQuery if you want to use the colon in regular SQL. Best regards, Jan