ODBC on Oracle-Existing Column with _ is not accessible

rthswrthsw Member Posts: 73
Hi there,
i have to connect to an Oracle Database wiht Navision 3.70 do Oracle 9i via MDAC 2.7/2.8 (both tested).
I will resolve a view, i know the Column names. If i only access fields with nomral names, i get the results if i resolve Names with underscore, navision errors (translated by me) The call to member Field is missed. ADODB.Fields gives the following message: An Object, which Name or Ordinalpointer fits, could not be found. ('Der Aufruf zum Member Item ist fehlgeschlagen. ADODB.fields gab die folgende Meldung zurück: Ein Objekt, das dem angeforderten Namen oder dem Ordinalverweis entspricht, kann nicht gefunden werden.'). Excel over MS-Query, or Aqua (an very usefull Oracle-Admintool) shows the column with all Entrys.
My Code:
//The bold-marked field is the blocking Column. If i ommit the bold //marked Line, i get the Records.


<Snip>
CREATE(ADOconnect);
ADOconnect.Open('DSN=BSS;UID=thoene;PWD=Rene');
CREATE(ADOrecset);
SQLstring := 'SELECT ARTIKEL_ID, MANDANT, SERIENNUMMER, REFERENZGEW, MENGE, RESERVIERT '+
'from KND_VIEW.INNER_BOX_V where (ARTIKEL_NR_A <> ''BSS-Dummy'') order by ARTIKEL_NR_A,SERIENNUMMER';

ADOrecset.Open(SQLstring,ADOconnect,OpenMethod::Keyset,LockMethod::Optimistic);

IF GUIALLOWED THEN
Window.UPDATE(1,'FindFirst');

ADOrecset.MoveFirst;

WHILE NOT ADOrecset.EOF DO BEGIN
RecCounter += 1;
TmpInventory."G/L Account" :=
COPYSTR(FORMAT(ADOrecset.Fields.Item('ARTIKEL_ID').Value),1,MAXSTRLEN(TmpInventory."G/L Account"));
TmpInventory."Gen. Bus. Posting Group" :=
COPYSTR(FORMAT(ADOrecset.Fields.Item('MANDANT').Value),1,MAXSTRLEN(TmpInventory."Gen. Bus. Posting Group"));

TmpInventory."Gen. Prod. Posting Group" :=
COPYSTR(FORMAT(ADOrecset.Fields.Item('SERIENNUMMER').Value),1,MAXSTRLEN(TmpInventory."Gen. Prod. Posting Group"));

And another problem: Both the Fields Seriennummer and the Field Mandant are defined as VARCHART(20) in Oracle. Navision Extract the content of the Mandant, but on the field Seriennummer, Navision breaks with Incompatible Fieldtype, with a list of the allowed Fieldtypes, including Varchar.

I hope very strong on the Oracle/ODBC Hackers Outside.

PS: There is absolute shure no Type-error, at last i copied the Fieldname with STRG+C and Paste it to Navision.
Sign In or Register to comment.