ODBC Error After Merge Replication Applied RRS feed

  • General discussion

  • I have a SQL database that is accessed via ODBC from an application.

    After applying Merge Replication (which adds a rowguid column) some of the queries from the application via ODBC are failing.

    The queries are basically "select * from table where column = 'abc'". The query actually executes without error but the error "4149 [Microsoft][ODBC Driver Manager] Program type out of range" occurs when the it attempts to access the first row of the query result. I have obtained the query text from a debug log and it returns at least one a row in SSMS.

    I have seen a similar issues with select into queries that use select *, due to the addition of the rowguid column. The fix was to change the select statement to use specifically named columns. Could something similar be happening in ODBC (sqlclient11 by the way).

    R Campbell

    Sunday, July 1, 2018 6:35 AM

All replies

  • I have since found a work around which is to create views of the tables that have all but the rowguid columns then basically search for "select * from table "and replace it with "select * from vw_table" in application scripts. It is fortunate that I am in a position to do this.

    It would seem that ODBC can't process rowguid (uniqueidentifier) even though they are basically text.

    R Campbell

    Monday, July 2, 2018 3:51 AM