Skip to main content
Skip table of contents

Database accesses (texts)


Database accesses (texts)

Database access can be conducted directly from the text component.

Through the menu function "Insert - database..., a working database field is created, however physical file names are also saved in the field as well. Therefore, it is better to limit information to the necessary parts to guarantee execution is possible on other PC’s:

{ DATENBASE\c "DSN=<ODBC-DataSource>;" \s "<SQL-Command>" \t "1" \l "0" }

Please note:

Only unambiguous data sets can be read using this command (the SQL command may only return one data set as a result). Moreover, the memo-field must not contain any line breaks ! If one of these rules is violated Microsoft Word will enter an infinite loop which can only be ended by the command "Close application"!

If the above constraints cannot be guaranteed for all data sets Word can only insert a table with headlines (=field names). The table format is determined using the switch "\l" . Therefore the above command has to be equipped with the switch "\h" (header = table headlines):

{ DATENBASE\c "DSN=<ODBC-Data source>;" \s "<SQL-Command>" \t "1" \l "0" \h }

Example:

Read the field "Memo text" from the table "Texts" from the database with the ODBC data sources names "TextDB" from the dataset identified by the primary key with the number "postext.TextID" which is determined through ePOS:

{ DATABASE \c "DSN=TextDB;" \s "SELECT Texts.MemoText FROM Texts WHERE (Texts.TextID= { DOCVARIABLE postext.TextID } )" \t "1" \l "0" }

Remark: For some SalesManager tables the above example can be realized through special additional functions, e.g. for TM_Texte the function p$TDV:SMPAPI:EtTxRTF is provided.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.