access odbc-capable DB through C/AL ?

rkadenbachrkadenbach Member Posts: 15
edited 2002-12-18 in Navision Financials
Hello,
Does anybody know, if it is possible to access any odbc-capable database through Navision C/AL-Code?
We have to access a Document Managment System which is separate from Navision-DB. We could write a program in SQL, but this query needs too much time.

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Prerequisites:
    ODBC DSN='TST'
    MS Access Database 'task.mdb'
    MS Access Database Table 'Groups'
    Table Field 'GroupID'

    VAR:
    OBJdbConnection Automation('Microsoft ActiveX Data Objects 2.6 Library'.Connection);
    RSGroups Automation('Microsoft ActiveX Data Objects 2.6 Library'.Recordset);
    CREATE(OBJdbConnection);
    OBJdbConnection.Open('TST','Admin','');
    CREATE(RSGroups);
    RSGroups.Open('Groups', OBJdbConnection);
    RSGroups.MoveFirst;
    IF NOT RSGroups.EOF THEN
      REPEAT
        MESSAGE('%1', RSGroups.Fields().Item('GroupID').Value);
        RSGroups.MoveNext;
      UNTIL RSGroups.EOF;
    RSGroups.Close;
    OBJdbConnection.Close;
    CLEAR(OBJdbConnection);
    CLEAR(RSGroups);
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • rkadenbachrkadenbach Member Posts: 15
    Thanks,
    the first step is OK, i can connect the other DB without any error.But i can´t access any table. Everytime i got error""Expected lexical element not found <keyword>".
Sign In or Register to comment.