ODBC 42S22 Error for SQL Server Native Client for GIS workstation (1 Viewer)

Rx_

Nothing In Moderation
Local time
Today, 08:57
Joined
Oct 22, 2009
Messages
2,803
This is more of a tip than code.
Making a SQL View available, it was able to be consumed by Access, Excel, and Oracle DB.
However the GIS division had this error 42S22.
Note: I am listing 42522 because many people searching also mistyped the number, the error message is hard to read.

Searching the internet, there wasn't much useful information on this.
Turned out that a field name was Well Locations with a space. I typically use an underscore Wells_Locations.
Sure enough, the underscore fixed it.

The GIS ODBC drivers have had funny issues before. Like for Access, just adding a primary key of an autonumber field might make it consumable.
Again, this exact same view with SQL Server Security (user name, password) could be consumed by Access using DSN-Less connection with SQL Server Native Client, ODBC connection, as could Excel and Oracle Shared Servers.

Rule number 1, never create a view with a space in the name. It was a typo on my part. It was hard to see the space and cost me way too much time and effort. :banghead:
Hopefully, this will show up on a search and help someone else.
 

Attachments

  • sQL Server Native Client error 42S22.png
    sQL Server Native Client error 42S22.png
    60.4 KB · Views: 283

Users who are viewing this thread

Top Bottom