Hi all, I have great problem by accessing Navision Attain Server from MS SQL Server 2000 by C/ODBC using “MS OLE DB provider for ODBC driver” in SQL server. I can see all tables on Navision linked server in Enterprise Manager, but then I try to access it from SQL server by writing: select * from OPENQUERY(“NAVISION-KLAIPEDOS KARTONAS”, ‘select * FROM Valiuta’)[/b] Error message appear [b]Server: Msg 7347, Level 16, State 1, Line 1 OLE DB provider ‘MSDASQL’ returned an unexpected data length for the fixed-length column ‘[MSDASQL].Datos_filtras’. The expected data length is 250, while the returned data length is 1. Can anybody help me with? Have anyone any ideas what’s wrong? Or are there any other solutions to access data from SQL server in Navision server throught C/ODBC?
I have seen this before and it may be that there is an update to C/ODBC to address this, but you’ll have to check. This is a problem with C/ODBC reporting meta data to the OLEDB provider that some of the data types are fixed length and not variable length. These are Code, Text and probably DateFormula. They are actually variable length but if C/ODBC reports that they are fixed length, then every piece of data should be the same (maximum) length - but they are usually not. When the OLDEDB provider gets a piece of data that is not the maximum length, it complains with this error. In your case a value of length 1 was delivered but as fixed length it should have been 250.