I am trying to connect to Navision database from SQL database using C/ODBC. If i try to select all fields (Select *) from a table and table has Flow Filters i receive ERROR message: Server: Msg 7347, Level 16, State 1, Line 1 OLE DB provider ‘MSDASQL’ returned an unexpected data length for the fixed-length column ‘[MSDASQL].Reason_Code_Filter’. The expected data length is 250, while the returned data length is 1. OLE DB error trace [Non-interface error: Unexpected data length returned for the column: ProviderName=‘MSDASQL’, TableName=’[MSDASQL]’, ColumnName=‘Reason_Code_Filter’, ExpectedLength=‘250’, ReturnedLength=‘1’].
Hi Valentin. I happened to be on partnerguide so I looked. I found the following similar posting:
One of our customer has a SQL 2000 Server SP3 and a Navision native Database Server. Now he tries to get data out of the Navision Database via ODBC and use a SELECT command at the SQL side. This works fine except the codefields. If he tries to get data from codefields he recieve the following error: OLE DB-Fehlertrace [Non-interface error: Unexpected data length returned for the column: ProviderName=‘MSDASQL’, TableName=’[MSDASQL]’, ColumnName=‘Nr_’, ExpectedLength=‘21’, ReturnedLength=‘8’] We tested this constellation ourself and recieve the same error in with any version of Navision (2.6/3.6). We are gratefully for any suggestions.
They reproduced it and sent it to HQ, who came back with the following response:
We have evaluated this issue and have concluded that it will not be corrected in this or coming releases. Due to new ODBC project in Sardinia.
I think i have been about as much help [:D]
Hey Val, you really shouldn’t need to pull FlowFilter fields from Navision, they really don;t make any sense outside of Navision. Instead of doing a select all, select the actual fields that you need.
hi…i can’t get any record from a navision table…some help?
agsboy, turn on the ODBC trace and rerun your query, immediately stop the trace and open it up. You should be able to see your problem in the trace log. I usually extract the sql statements from all the garbage and format them in an easier to read manner. Good Luck.