Select to view content in your preferred language

Impossible to convert XY to Point

1971
20
Jump to solution
10-23-2023 06:43 AM
Labels (1)
JasonBOCQUET
Frequent Contributor

Hi Community

 

I want to convert a table with an X and Y couple who is hosted in a database, but when i try to use the "Display XY Data" tool, i have this error :

JasonBOCQUET_0-1698068453607.png

 

What does it means ? 

 

0 Kudos
20 Replies
JasonBOCQUET
Frequent Contributor

It's Microsoft ODBC Driver 18 for SQL Server . I don't know for MS SQL Server if it is 2019 or 2022 version.

0 Kudos
Robert_LeClair
Esri Notable Contributor

Great - thank you.  Regardless of 2019 or 2022, the MS ODBC Driver 18 is correct.  One key here on the help - "** Microsoft changed the default encryption setting for the ODBC driver to yes with the release of ODBC Driver 18. To ensure existing database connections continue to work even if you update to ODBC Driver 18, encryption is set to no by default."  Do you know if the encrption is set to no?

0 Kudos
JasonBOCQUET
Frequent Contributor

I'm not in charge of the installation of our solution so i don't know. I have a easy way to know that ?

0 Kudos
Robert_LeClair
Esri Notable Contributor

A workaround is listed here that may work for you.

0 Kudos
JasonBOCQUET
Frequent Contributor

I try with Encrypt=no, i can connect to my database, but i have the same error.

And if I try with Encrypt=yes i can't connect to my database.

0 Kudos
Brian_Wilson
Honored Contributor

Warning about drivers, don't do what I did, I installed ODBC 17 without removing ODBC 18. Turns out you can have both installed at the same time and it will pick 18. In my experience 18 works just fine with Pro but not with ArcMap.

 

0 Kudos
Brian_Wilson
Honored Contributor

BTW I am just some guy so feel free to totally ignore me 🙂 Robert will eventually figure this out.

Looking at the actual code (since it's Python we can do that),

    if empty_out_bounds:
        arcpy.AddIDMessage("WARNING", 100160)
        arcpy.AddIDMessage("WARNING", 192, "{}: {}".format(str(arcpy.GetIDMessage(84526)).lower(), 
                

It is saying "if there is something in the list empty_out_bound, then send a warning message".  It has some code that is inside a try/except that's firing... it's doing an insertRow so that's where it dies. It looks like up near the top it creates the feature class. Is that happening? If so then you have write permissions and you have database access. The line about "invalid syntax near 'voie'" is weird... that's why I asked for the screenshot.

What's a "voie" and where is that coming from??

Since the error is tripping on an "insert" call it means output is still going to a database. I don't get that.

I would try generating a subset of the input data (like, 3 rows?) and put it into a CSV file and write to a shapefile therefore removing ODBC from the whole thing and see what happens then.

Keep breaking the problem down into smaller and smaller pieces.

Wheee fun fun.

JasonBOCQUET
Frequent Contributor

"voie" is a french term to said "road"

I have this term in my header column some times : 

JasonBOCQUET_0-1698162221860.png

 

0 Kudos
Brian_Wilson
Honored Contributor

Could a special character in the column name throw the SQL error??

I saw that degree marker in there. A cold chill ran down my spine. (Then I realized my windows is open.)

Try a file with safer column names.

 

JasonBOCQUET
Frequent Contributor

The error was very stupid.

The space between the name of some columns made the error. I removed the spaces and the "°" and it works fine

 

Thanks for your help !

0 Kudos